From: Jelle Zijlstra Date: Thu, 26 Sep 2024 06:26:03 +0000 (-0700) Subject: gh-101100: Make __subclasses__ doctest stable (#124577) X-Git-Tag: v3.14.0a1~320 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=08a467b537b3d9b499d060697e79b3950374ab0f;p=thirdparty%2FPython%2Fcpython.git gh-101100: Make __subclasses__ doctest stable (#124577) Using a standard library class makes this test difficult to maintain as other tests and other parts of the stdlib may create subclasses, which may still be alive when this test runs depending on GC timing. --- diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index a6348eda3891..5ce6bf17db41 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1109,8 +1109,10 @@ have the following two methods available: .. doctest:: - >>> int.__subclasses__() - [, , , , ] + >>> class A: pass + >>> class B(A): pass + >>> A.__subclasses__() + [] Class instances ---------------