Serhiy Storchaka <storchaka+cpyt...@gmail.com> added the comment:
3. There is also a crash in isinstance(): >>> class BadMeta(type): ... def __instancecheck__(cls, inst): ... 1/0 ... >>> x = int | BadMeta('A', (), {}) >>> isinstance([], x) Fatal Python error: _Py_CheckFunctionResult: a function returned a result with an exception set Python runtime state: initialized Traceback (most recent call last): File "<stdin>", line 3, in __instancecheck__ ZeroDivisionError: division by zero The above exception was the direct cause of the following exception: SystemError: <built-in method __instancecheck__ of types.Union object at 0x7f024bbb8960> returned a result with an exception set Current thread 0x00007f024beb1280 (most recent call first): File "<stdin>", line 1 in <module> Aborted (core dumped) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue44606> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com