-
-
Notifications
You must be signed in to change notification settings - Fork 33k
Closed
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Description
Documentation
Several examples in Doc/library/enum.rst
are meant to be runnable as standalone doctest-style blocks, but a few miss required imports (Enum
, auto
, StrEnum
). Adding minimal from enum import ...
lines makes each block self-contained.
The current documentation is correct; this change simply improves convenience for newcomers and first-time readers by making the snippets runnable in isolation.
Example (why this helps):
Before (fails):
>>> class Weekday(Enum):
... MONDAY = 1
NameError: name 'Enum' is not defined
After (works):
>>> from enum import Enum
>>> class Weekday(Enum):
... MONDAY = 1
Notes
- The change aims to be minimal and localized to the affected blocks.
- No NEWS entry should be required (docs-only).
Linked PRs
Metadata
Metadata
Assignees
Labels
docsDocumentation in the Doc dirDocumentation in the Doc dir
Projects
Status
Todo