Author stutzbach
Recipients ajaksu2, amaury.forgeotdarc, benjamin.peterson, flox, pitrou, stutzbach
Date 2010-03-31.00:36:33
SpamBayes Score 9.83275e-05
Marked as misclassified No
Message-id <>
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)
Date User Action Args
2010-03-31 00:36:35stutzbachsetrecipients: + stutzbach, amaury.forgeotdarc, pitrou, ajaksu2, benjamin.peterson, flox
2010-03-31 00:36:35stutzbachsetmessageid: <>
2010-03-31 00:36:34stutzbachlinkissue2521 messages
2010-03-31 00:36:33stutzbachcreate