Message210141
When using an abstract base class, super(type, obj) throws a TypeError stating "obj must be an instance (...) of type", even though isinstance(obj, type) returns True. I'm not sure what is supposed to happen here, but either the error message and the documentation for super would need to be reformulated, or there is an issue with the implementation, or I am misunderstanding something.
Python 3.3.3 (default, Dec 12 2013, 11:13:02)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-3)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numbers
>>> super(numbers.Number, 0)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: super(type, obj): obj must be an instance or subtype of type
>>> isinstance(0, numbers.Number)
True |
|
Date |
User |
Action |
Args |
2014-02-03 15:36:42 | Gerrit.Holl | set | recipients:
+ Gerrit.Holl |
2014-02-03 15:36:42 | Gerrit.Holl | set | messageid: <1391441802.61.0.557224247712.issue20503@psf.upfronthosting.co.za> |
2014-02-03 15:36:42 | Gerrit.Holl | link | issue20503 messages |
2014-02-03 15:36:42 | Gerrit.Holl | create | |
|