Review request for Issue #92810

There is an issue #92810 - isinstance(ABC_subclass, ...)/issubclass(ABC_subclass, ...) can consume gigabytes of RAM if few thousand unlrelated classes are created and compared with each other. There are 4 related PRs:

The main question here “should ABC.__subclasses__override influence the behavior of isinstance/issubclass” - overriding __subclasses__ for a regular classes (with no metaclass) have no influence in isinstance/issubclass behavior. If answer is “no”, then Implementation 3 is recommended.

I haven’t found any examples on Github where __subclassess__ are overriden, other than Mocks and custom metaclasses.

A review would be appreciated.

1 Like