mirror of https://github.com/python/cpython
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.
This commit is contained in:
parent
1229cb8c14
commit
08a467b537
|
@ -1109,8 +1109,10 @@ have the following two methods available:
|
||||||
|
|
||||||
.. doctest::
|
.. doctest::
|
||||||
|
|
||||||
>>> int.__subclasses__()
|
>>> class A: pass
|
||||||
[<class 'bool'>, <enum 'IntEnum'>, <flag 'IntFlag'>, <class 're._constants._NamedIntConstant'>, <class 're._ZeroSentinel'>]
|
>>> class B(A): pass
|
||||||
|
>>> A.__subclasses__()
|
||||||
|
[<class 'B'>]
|
||||||
|
|
||||||
Class instances
|
Class instances
|
||||||
---------------
|
---------------
|
||||||
|
|
Loading…
Reference in New Issue