Skip to content

docs: aenum and stdlib enum unions render as IntEnum | IntEnum and Enum | Enum #1858

Closed

Description

@JarryShaw

Parameters annotated StdlibIntEnum | AenumIntEnum render as IntEnum | IntEnum: the first links to Python's enum.IntEnum and the second is plain text. Examples are protocol make parameters across the layers, corekit/fields and dumpkit/pcap.py:114. render_enum(o: 'enum.Enum | aenum.Enum') (dumpkit/common.py:195) renders Enum | Enum. This persists on sphinx-autodoc-typehints 3.15.0.

Root cause: typehints_fully_qualified = False (docs/source/conf.py:196) shortens both classes to the bare name, and aenum has no inventory (conf.py:144-153), so the two look identical.

Fix: a typehints_formatter that renders aenum classes qualified (aenum.IntEnum) and returns None otherwise; a prototype fixed every parameter and return type. Bases: lines such as NumberField[IntEnum | IntEnum] go through Sphinx's restify and are not covered by the formatter. Only one typehints_formatter can be configured, so any other formatter-based fix has to share it.

Activity

  1. added
    docsPull requests that change documentation only (docs: subject prefix)
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 16, 2026
  2. JarryShaw commented on Oct 16, 2026

    @JarryShaw
    OwnerAuthor

    Blocked until #1856 merges. That PR bumps sphinx-autodoc-typehints, which changes how signatures render, and it edits docs/source/conf.py, which this fix also edits.

  3. added
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 16, 2026
  4. moved this to Blocked in PyPCAPKiton Oct 16, 2026
  5. JarryShaw commented on Oct 17, 2026

    @JarryShaw
    OwnerAuthor

    Started on top of #1877, the PR for #1856, so the conf.py edits don't conflict. One worker is taking #1858–#1863 together, since every fix goes through conf.py.

  6. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    on Oct 17, 2026
  7. moved this from Blocked to WIP in PyPCAPKiton Oct 17, 2026
  8. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 17, 2026
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

    docsPull requests that change documentation only (docs: subject prefix)

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions