[issue30570] issubclass segfaults on objects with weird __getattr__

Louie Lu report at bugs.python.org
Sun Jun 4 22:31:55 EDT 2017


Louie Lu added the comment:

Without this segfault, I think you do a wrong operation. In other cases, for example:

>>> issubclass(10, int)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: issubclass() arg 1 must be a class


`issubclass` will return TypeError on instance, if you test as `issubclass(Failure, int)` or `issubclass(Failure().__class__, int`, it should get the correct answer.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30570>
_______________________________________


More information about the Python-bugs-list mailing list