diff options
author | Emile Anclin <emile.anclin@logilab.fr> | 2010-09-13 15:09:57 +0200 |
---|---|---|
committer | Emile Anclin <emile.anclin@logilab.fr> | 2010-09-13 15:09:57 +0200 |
commit | 4ef71160c871b225078917c17f4393146838ee4b (patch) | |
tree | 4293b6ed7c0ed85aaf774d170fb045293f1a1c68 /compat.py | |
parent | 215170f7b48fe1ad685d2c8785b4f47152ddbd15 (diff) | |
download | logilab-common-4ef71160c871b225078917c17f4393146838ee4b.tar.gz |
[py3k] add callable to compat.py
import "callable" where needed.
We can't use collections in python <= 2.5
Diffstat (limited to 'compat.py')
-rw-r--r-- | compat.py | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -31,6 +31,14 @@ from warnings import warn import __builtin__ try: + callable = callable +except NameError:# callable removed from py3k + import collections + def callable(something): + return isinstance(something, collections.Callable) + del collections + +try: set = set frozenset = frozenset except NameError: |