mirror of
https://github.com/python/cpython.git
synced 2025-12-23 09:19:18 +00:00
[3.12] gh-101100: Make __subclasses__ doctest stable (GH-124577) (#124580)
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 08a467b537)
This commit is contained in:
parent
2b54a4ebf1
commit
d4cd39097e
1 changed files with 4 additions and 2 deletions
|
|
@ -1048,8 +1048,10 @@ have the following two methods available:
|
|||
|
||||
.. doctest::
|
||||
|
||||
>>> int.__subclasses__()
|
||||
[<class 'bool'>, <enum 'IntEnum'>, <flag 'IntFlag'>, <class 're._constants._NamedIntConstant'>]
|
||||
>>> class A: pass
|
||||
>>> class B(A): pass
|
||||
>>> A.__subclasses__()
|
||||
[<class 'B'>]
|
||||
|
||||
Class instances
|
||||
---------------
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue