This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Gerrit.Holl
Recipients Gerrit.Holl
Date 2014-02-03.15:36:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1391441802.61.0.557224247712.issue20503@psf.upfronthosting.co.za>
In-reply-to
Content
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
History
Date User Action Args
2014-02-03 15:36:42Gerrit.Hollsetrecipients: + Gerrit.Holl
2014-02-03 15:36:42Gerrit.Hollsetmessageid: <1391441802.61.0.557224247712.issue20503@psf.upfronthosting.co.za>
2014-02-03 15:36:42Gerrit.Holllinkissue20503 messages
2014-02-03 15:36:42Gerrit.Hollcreate