Skip to content

Commit 038e10c

Browse files
committed
Update internal documentation to describe type(instance) is cls edge case of PyObject_IsInstance
1 parent bc8102c commit 038e10c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Doc/c-api/object.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,9 @@ Object Protocol
433433
434434
If *cls* has a :meth:`~type.__instancecheck__` method, it will be called to
435435
determine the subclass status as described in :pep:`3119`. Otherwise, *inst*
436-
is an instance of *cls* if its class is a subclass of *cls*.
436+
is an instance of *cls* if its class is a subclass of *cls*. If *inst* is
437+
an instance of *cls*, this will return ``1`` and will not call
438+
:meth:`~type.__instancecheck__`.
437439
438440
An instance *inst* can override what is considered its class by having a
439441
:attr:`~object.__class__` attribute.

0 commit comments

Comments
 (0)