You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
3.12 documentation for enum.Enum.__dir__ says that this method returns "['__class__', '__doc__', '__module__', 'name', 'value'] and any public methods defined on self.__class__", but this is not true, e.g. when using the code provided:
Also it seems that test_enum has bug in it, because it doesn't detect the error above if invoked through libregrtest (as ./python -m test test_enum), but direct run of test_enum or doctest on enum documentation fails:
$ ./python -m test.test_enum
...........................................................................................................................................s.s......s........................................................................................................................................................................................................................................................................................................................s...........................................s...............................................................................................F
======================================================================
FAIL: /home/chgnrdv/cpython/Lib/test/../../Doc/library/enum.rst
Doctest: enum.rst
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/chgnrdv/cpython/Lib/doctest.py", line 2228, in runTest
raise self.failureException(self.format_failure(new.getvalue()))
AssertionError: Failed doctest test for enum.rst
File "/home/chgnrdv/cpython/Lib/test/../../Doc/library/enum.rst", line 0
----------------------------------------------------------------------
File "/home/chgnrdv/cpython/Lib/test/../../Doc/library/enum.rst", line 297, in enum.rst
Failed example:
dir(Weekday.SATURDAY)
Expected:
['__class__', '__doc__', '__eq__', '__hash__', '__module__', 'name', 'today', 'value']
Got:
['FRIDAY', 'MONDAY', 'SATURDAY', 'SUNDAY', 'THURSDAY', 'TUESDAY', 'WEDNESDAY', '__class__', '__doc__', '__eq__', '__hash__', '__module__', 'name', 'today', 'value']
----------------------------------------------------------------------
Ran 602 tests in 5.113s
FAILED (failures=1, skipped=5)
3.12 documentation for
enum.Enum.__dir__
says that this method returns "['__class__', '__doc__', '__module__', 'name', 'value']
and any public methods defined onself.__class__
", but this is not true, e.g. when using the code provided:Also it seems that
test_enum
has bug in it, because it doesn't detect the error above if invoked throughlibregrtest
(as./python -m test test_enum
), but direct run oftest_enum
ordoctest
onenum
documentation fails:I'm working on fixes for both errors.
Linked PRs
test_enum
#104236enum.Enum.__dir__
#104237The text was updated successfully, but these errors were encountered: