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

Open

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
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)needs: decisionWaiting on the maintainer to decide — not blocked by other work

    Projects

    • Status
      Needs decision

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions