instancecheck and subclasscheck are part of the fundamental protocols supported by objects in Python, and they are used in the standard library to support type checking via interfaces (e.g., isinstance(x, collections.Iterable) instead of type(x) is list)
This talk discusses how they work, from an end-user perspective and from the perspective of a CPython developer, and what these can be used for (e.g., modelling problems with user-defined, custom type systems.) This talk will also discuss real-world problems in a giant, multi-million line Python system that the presenter has seen and resolved using knowledge of these constructs.
Status: Accepted