Message341581
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() |
|
Date |
User |
Action |
Args |
2019-05-06 18:08:20 | Mark.Shannon | set | recipients:
+ Mark.Shannon, vstinner, serhiy.storchaka, abarry, mdk, sjpalt |
2019-05-06 18:08:20 | Mark.Shannon | set | messageid: <1557166100.67.0.559705219874.issue28866@roundup.psfhosted.org> |
2019-05-06 18:08:20 | Mark.Shannon | link | issue28866 messages |
2019-05-06 18:08:20 | Mark.Shannon | create | |
|