Mark Shannon <m...@hotpy.org> added the comment:

This failure appears to be a symptom of recursively traversing __bases__ rather 
scanning __mro__ in the implementation of type.__subclasses__
The MCACHE depends on type.__subclasses__ being correct and it is not correct 
for weird.py

python -i weird.py
>>> C = Meta("C", (), {})
>>> C.__mro__
(<class '__main__.C'>, <class '__main__.Foo'>, <class 'object'>)
>>> Foo.__subclasses__()
[]
>>> C.__bases__
(<class 'object'>,)

Fixing this may need a change in the API for type.__subclasses__() to return 
all subclasses, as defined by __mro__, not just the bases.

A simpler, temporary fix might be to set Py_TPFLAGS_HAVE_VERSION_TAG to 0 for 
any class that has a custom mro()

----------
nosy: +Mark.Shannon

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue28866>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to