FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

doc(enum): add missing imports so standalone examples run as-is · Issue #139487 · python/cpython · GitHub

Repository navigation

doc(enum): add missing imports so standalone examples run as-is #139487

Closed

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

Activity

  1. added
    docsDocumentation in the Doc dir
    on Oct 2, 2025
  2. added a commit that references this issue on Oct 2, 2025
  3. added 2 commits that reference this issue on Oct 2, 2025
  4. added a commit that references this issue on Oct 2, 2025
  5. added a commit that references this issue on Oct 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    docsDocumentation in the Doc dir

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


    Back | FazBrowse Home | New Git URL