]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
#5324: document __subclasses__().
authorGeorg Brandl <georg@python.org>
Sat, 28 Mar 2009 19:10:37 +0000 (19:10 +0000)
committerGeorg Brandl <georg@python.org>
Sat, 28 Mar 2009 19:10:37 +0000 (19:10 +0000)
Doc/library/stdtypes.rst

index 5500f4fecfd5a1bf9c8870352c331a21bb9df2a1..f3ff505b0bff3821f8c374c0285ad18b13114cb7 100644 (file)
@@ -2674,6 +2674,17 @@ types, where they are relevant.  Some of these are not reported by the
 
    The name of the class or type.
 
+
+.. method:: class.__subclasses__
+
+   :term:`New-style class`\ es keep a list of weak references to their immediate
+   subclasses.  This method returns a list of all those references still alive.
+   Example::
+
+      >>> int.__subclasses__()
+      [<type 'bool'>]
+
+
 .. rubric:: Footnotes
 
 .. [#] Additional information on these special methods may be found in the Python