Skip to content

docs(corekit): EnumField.post_process Notes misstate which registries bound themselves to a width #2178

Closed

Description

@JarryShaw

What: the Notes in EnumField.post_process say the registries that bound themselves to a width "are the bit-flag ones", and that none of them is the namespace of a plain EnumField. Both claims are wrong. 115 of the 118 generated _missing_ methods under pcapkit/const range-check 0 <= value <= N and raise a bare ValueError. The three that don't are http/method, ipv4/protection_authority and pcapng/filter_type.

Behaviour is fine: the bare ValueError is exactly the fallback this method catches.

Fix: say that the generated guards bound their own width, and that this is harmless because the method falls back on the bare ValueError.

Found by #1103 round 5. Confirmed on main 4c3d30163.

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 25, 2026
  2. moved this to Pending in PyPCAPKiton Oct 25, 2026
  3. added
    wipWork in flight - a covering PR is open or an agent is actively on it
    and removed
    pendingAccepted and unstarted - nobody is on it and nothing blocks it
    on Oct 25, 2026
  4. moved this from Pending to WIP in PyPCAPKiton Oct 25, 2026
  5. JarryShaw commented on Oct 25, 2026

    @JarryShaw
    OwnerAuthor

    Correction to the issue text. The exception list above is wrong. #2192's prose names no list, so the PR is unaffected.

    • pcapng/filter_type does range-check. FilterType._missing_ raises outside 0x00 <= value <= 0xFF; the bound is written in hex, so a decimal-only scan missed it.
    • An AST scan of every generated _missing_ (re-derived in the docs(corekit): say which generated registries bound their width (#2178) #2192 cross-review) finds these without a two-sided raising guard:
      • ftp/command: Command, FEATCode (str-keyed);
      • http/method: Method (str-keyed);
      • ipv4/protection_authority: lower bound only;
      • ftp/return_code: ResponseKind, GroupingInformation, which have no raising guard at all.
    • The counts above are off as well; disregard them.
  6. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Oct 25, 2026
  7. added this to the PyPCAPKit v1.5 milestone on Oct 26, 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

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions