Message97175
The following sequence causes isinstance to raise an exception rather than to return False.
>>> class foo:
... pass
...
>>> import collections
>>> isinstance(foo,collections.Callable)
True
>>> isinstance(foo(),collections.Callable)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/abc.py", line 131, in __instancecheck__
return (cls.__subclasscheck__(subclass) or
File "/usr/lib/python2.6/abc.py", line 147, in __subclasscheck__
ok = cls.__subclasshook__(subclass)
File "/usr/lib/python2.6/_abcoll.py", line 117, in __subclasshook__
if any("__call__" in B.__dict__ for B in C.__mro__):
AttributeError: class foo has no attribute '__mro__'
>>> |
|
Date |
User |
Action |
Args |
2010-01-03 19:13:33 | rgammans | set | recipients:
+ rgammans |
2010-01-03 19:13:33 | rgammans | set | messageid: <1262546013.12.0.84768475199.issue7624@psf.upfronthosting.co.za> |
2010-01-03 19:13:31 | rgammans | link | issue7624 messages |
2010-01-03 19:13:31 | rgammans | create | |
|