[issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results

2021-12-23 Thread Carl Friedrich Bolz-Tereick
Carl Friedrich Bolz-Tereick added the comment: Or, in other words, in my opinion this is the root cause of the bug: class Base: def __init_subclass__(cls): global broken_class broken_class = cls assert 0 try: class Broken(Base): pass except: pass assert

[issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results

2021-12-23 Thread Carl Friedrich Bolz-Tereick
Carl Friedrich Bolz-Tereick added the comment: hm, I think I figured it out. The root cause is that even though the creation of the class Triffid fails, it can still be found via Animal.__subclasses__(), which the special subclass logic for ABCs is looking at. Triffid fills its _abc_impl

[issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results

2021-12-15 Thread hongweipeng
Change by hongweipeng : -- keywords: +patch pull_requests: +28335 stage: -> patch review pull_request: https://github.com/python/cpython/pull/30112 ___ Python tracker ___

[issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results

2021-09-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Confirmed that this weird behavior is still present. Am not sure when someone will have the time and inclination to drill into the cause. -- nosy: +rhettinger ___ Python tracker

[issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results

2021-09-16 Thread Raymond Hettinger
Change by Raymond Hettinger : -- nosy: +lukasz.langa ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results

2021-09-14 Thread xitop
xitop added the comment: 2nd anniversary. Any reaction from developers would be appreciated. Thank you. -- ___ Python tracker ___

[issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results

2020-12-25 Thread xitop
xitop added the comment: Python 3.9.1 is affected too. -- versions: +Python 3.9 ___ Python tracker ___ ___ Python-bugs-list

[issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results

2020-11-16 Thread hongweipeng
hongweipeng added the comment: Class `Triffid` failed to create in `__init_subclass__`, so `Triffid._abc_cache` uses its base class `_abc_cache`. -- nosy: +hongweipeng ___ Python tracker

[issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results

2019-12-28 Thread xitop
xitop added the comment: Please, could some experienced Python developer take a look at this issue reported more than 3 month ago? -- ___ Python tracker ___

[issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results

2019-10-21 Thread xitop
xitop added the comment: Same problem also in Python 3.6.8 and the new 3.8.0. -- versions: +Python 3.6, Python 3.8 ___ Python tracker ___

[issue38085] Interrupting class creation in __init_subclass__ may lead to incorrect isinstance() and issubclass() results

2019-09-10 Thread xitop
New submission from xitop : An exception in __init__subclass__ leads under certain circumstances to wrong isinstance() and issubclass() results. The exception probably leaves Python internal data in inconsistent state. Here is a demonstration program from Stack Overflow: --- begin -- from