[docs] [issue33417] Isinstance() behavior is not consistent with the document

Terry J. Reedy report at bugs.python.org
Fri May 4 17:42:39 EDT 2018


Terry J. Reedy <tjreedy at udel.edu> added the comment:

https://docs.python.org/3/reference/datamodel.html#customizing-instance-and-subclass-checks
says
"Note that these methods are looked up on the type (metaclass) of a class. They cannot be defined as class methods in the actual class. This is consistent with the lookup of special methods that are called on instances, only in this case the instance is itself a class."

IE, your first example is documented as wrong.  Your second example, which works, follows the example in
https://docs.python.org/3/reference/datamodel.html#customizing-instance-and-subclass-checks

----------
nosy: +terry.reedy
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed
versions: +Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue33417>
_______________________________________


More information about the docs mailing list