Skip to content

docs(conventions): Command.get and Method.get do more than fold, against registry-protocol.rst's "a folding override carries only the fold" #2553

Closed

Description

@JarryShaw

From the 2026-11-01 conventions audit, re-verified on 73add05a3. registry-protocol.rst, "RFC-Directed Case Sensitivity": a folding override carries only the fold, TransportProtocol.get being the example; "get Override Obligations": an override that diverges from the base's contract is a defect, not a local judgement.

  • Command.get in pcapkit/const/ftp/command.py folds and also (1) returns _unregistered_member(default if default is not None else key, name) on a name miss, where the base raises EnumKeyError (Command.get('xyzzy') returns a Command.XYZZY with value 'xyzzy'); (2) uses default as that member's value, where the base's default must name a registered value; (3) sends a non-str key to super().get(key) without default, so Command.get(5, 'USER') raises EnumValueError where EnumLookup.get returns USER.
  • Method.get in pcapkit/const/http/method.py does (1) to (3) with no fold.
  • Both docstrings disclose this, (1) following const: bring the 16 bespoke registries onto EnumRegistry, after fixing the base's str-key dispatch #860's no-mint ruling and (3) fix(const): Command.get calls key.upper() on any key, so bytes mint and ints raise AttributeError #1824's fix; (2) is documented but traced to no ruling. The page describes Method.get's unregistered member as intended near its end, not as an exception to the two rules above, so it contradicts itself.

Decision needed: are these exceptions or defects?

  1. Exceptions: state them on the page, naming const: bring the 16 bespoke registries onto EnumRegistry, after fixing the base's str-key dispatch #860 and fix(const): Command.get calls key.upper() on any key, so bytes mint and ints raise AttributeError #1824 and what default means on these two classes.
  2. Defects: conform both overrides to the base (observable: Command.get('xyzzy') and Method.get('ZZZ') raise instead of returning a member).
    Recommendation: 1, because the docstrings already document all three and (1) is the no-mint design const: bring the 16 bespoke registries onto EnumRegistry, after fixing the base's str-key dispatch #860 settled; ask the owner about (2), the one point no ruling covers.
    Fix: per the decision; option 1 edits registry-protocol.rst, which feat(registry): foundation.registry wrappers for IPX and SCTP sub-maps; record the convention (#2511) #2521 also edits.

Activity

  1. added
    docsPull requests that change documentation only (docs: subject prefix)
    needs: decisionWaiting on the maintainer to decide — not blocked by other work
    on Nov 1, 2026
  2. moved this to Needs decision in PyPCAPKiton Nov 1, 2026
  3. JarryShaw commented on Nov 1, 2026

    @JarryShaw
    OwnerAuthor

    Take 1. Case insensitive and Python naming conventions.

  4. JarryShaw commented on Nov 1, 2026

    @JarryShaw
    OwnerAuthor

    Owner chose 1, paraphrased: these are exceptions, not defects. registry-protocol.rst states them:

    The page also says what default means on Command and Method, and stops calling Method.get's unregistered member intended in a way that contradicts the two rules above it.

    Blocked: this edits registry-protocol.rst, which #2521 also edits, so it unblocks when #2521 merges. It then joins #2551, #2552, #2556 and #2565 in one worker.

  5. added
    blockedDeferred pending another issue or decision; see the last comment for what unblocks it
    and removed
    needs: decisionWaiting on the maintainer to decide — not blocked by other work
    on Nov 1, 2026
  6. moved this from Needs decision to Blocked in PyPCAPKiton Nov 1, 2026
  7. JarryShaw commented on Nov 1, 2026

    @JarryShaw
    OwnerAuthor

    Unblocked: #2521 merged, so registry-protocol.rst is free. Dispatched together with the page's other queued fixes (#2551, #2552, #2553, #2556, #2565) as one worker and one PR.

  8. 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 Nov 1, 2026
  9. moved this from Blocked to WIP in PyPCAPKiton Nov 1, 2026
  10. removed
    wipWork in flight - a covering PR is open or an agent is actively on it
    on Nov 1, 2026
  11. added this to the PyPCAPKit v1.6 milestone on Nov 2, 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