[Python-checkins] cpython (3.4): Closes #22507: document that PyType_IsSubtype does not call __subclasscheck__.

georg.brandl python-checkins at python.org
Mon Oct 6 14:15:22 CEST 2014


https://hg.python.org/cpython/rev/dbf2a52575ee
changeset:   92842:dbf2a52575ee
branch:      3.4
parent:      92839:aafc0d0a18a2
user:        Georg Brandl <georg at python.org>
date:        Mon Oct 06 14:15:06 2014 +0200
summary:
  Closes #22507: document that PyType_IsSubtype does not call __subclasscheck__.

files:
  Doc/c-api/type.rst |  6 ++++++
  1 files changed, 6 insertions(+), 0 deletions(-)


diff --git a/Doc/c-api/type.rst b/Doc/c-api/type.rst
--- a/Doc/c-api/type.rst
+++ b/Doc/c-api/type.rst
@@ -44,6 +44,7 @@
 
    .. versionadded:: 3.2
 
+
 .. c:function:: void PyType_Modified(PyTypeObject *type)
 
    Invalidate the internal lookup cache for the type and all of its
@@ -67,6 +68,11 @@
 
    Return true if *a* is a subtype of *b*.
 
+   This function only checks for actual subtypes, which means that
+   :meth:`~type.__subclasscheck__` is not called on *b*.  Call
+   :c:func:`PyObject_IsSubclass` to do the same check that :func:`issubclass`
+   would do.
+
 
 .. c:function:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list