From a0799223ae39483f41b292e1f39826c1e73d5064 Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Thu, 26 Sep 2024 22:56:06 +0200 Subject: [3.13] gh-101100: Make __subclasses__ doctest stable (GH-124577) (#124579) gh-101100: Make __subclasses__ doctest stable (GH-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. (cherry picked from commit 08a467b537b3d9b499d060697e79b3950374ab0f) Co-authored-by: Jelle Zijlstra --- Doc/reference/datamodel.rst | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Doc/reference/datamodel.rst b/Doc/reference/datamodel.rst index dfc7e8e..45c4852 100644 --- a/Doc/reference/datamodel.rst +++ b/Doc/reference/datamodel.rst @@ -1053,8 +1053,10 @@ have the following two methods available: .. doctest:: - >>> int.__subclasses__() - [, , , , ] + >>> class A: pass + >>> class B(A): pass + >>> A.__subclasses__() + [] Class instances --------------- -- cgit v0.12