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 stutzbach
Recipients ajaksu2, amaury.forgeotdarc, benjamin.peterson, flox, pitrou, stutzbach
Date 2010-03-31.00:36:33
SpamBayes Score 9.832753e-05
Marked as misclassified No
Message-id <1269995795.85.0.944035344728.issue2521@psf.upfronthosting.co.za>
In-reply-to
Content
You can't register an old-style class, but many ABCs support duck-typing by implementing __subclasshook__.  ABCMeta caches those results and stores a reference to old-style classes, sometimes in _abc_cache and sometimes in _abc_negative_cache.  It can't simply return False.

I guess that leaves two options:

1) Make old-style classes weak-referenceable and cache the results of __subclasshook__.
2) Refuse to cache old-style classes and call __subclasshook__ every time for old-style classes.

Python 2.7a4+ (trunk:79493, Mar 30 2010, 19:19:13)
>>> class old_iterable_class:
...   def __iter__(self):
...     pass
...
>>> import collections
>>> issubclass(old_iterable_class, collections.Iterable)
True
History
Date User Action Args
2010-03-31 00:36:35stutzbachsetrecipients: + stutzbach, amaury.forgeotdarc, pitrou, ajaksu2, benjamin.peterson, flox
2010-03-31 00:36:35stutzbachsetmessageid: <1269995795.85.0.944035344728.issue2521@psf.upfronthosting.co.za>
2010-03-31 00:36:34stutzbachlinkissue2521 messages
2010-03-31 00:36:33stutzbachcreate