Repository navigation
fix(const): AppType.get takes EnumLookup.get's default and raises EnumValueError (#2545) - #2568
Merged
Merged
Conversation
…mValueError (#2545) - AppType.get, in the BASE template of pcapkit.vendor.reg.apptype.apptype, takes `default` positionally after `key`, resolved as EnumLookup.get resolves its own (through `_value2member_map_`, never minting), in the registry the key was dispatched to; the `# type: ignore[override]` / `arguments-differ` pair is gone. - A miss with no usable default raises a quiet EnumValueError with the message it raised before, in place of a builtin ValueError. - pcapkit.const.reg.apptype.apptype regenerated with `pcapkit-vendor reg.apptype`; only the two `get` methods change, the per-transport modules not at all. - reg.rst notes the change; the #2048 template-agreement test anchors on the new signature; tests/const/test_const_apptype_get_default_2545_unit.py pins the two-argument call, the fallback and each miss.
Owner
Author
|
Cross-review (Sonnet) at |
Contributor
|
Coverage: 93.95% (unit tier, Python 3.15,
Per-file detail: the |
JarryShaw
added a commit
that referenced
this pull request
Nov 1, 2026
- Added: one's-complement checksum verification and computation (#2543), and the IPX and SCTP registration wrappers (#2521). - Folded into unreleased entries: LinuxSLL/FRAD/Netlink registries (#2527), the IGMP class names (#2542), TLS record chaining and the SSLv2 trial's warnings (#2537), DTLS reassembly via Extractor and toolkit (#2528), and IP_Pseudo's walk at any depth (#2543). ICMP drops its stale checksum line. - Breaking: make() checksums, DRARP's module (#2540), IPv6 overlapping fragments (#2569), TCP_GAP_LIMIT replacing TCP.__window__ (#2579), and Extractor/extract's positional dtls (#2528). - Changed: member order (#2490), conventions (#2542, #2521, #2570), CI -n logical (#2572). Fixed: AppType.get (#2568), trial warnings (#2519, #2577). - CHANGELOG.md regenerated; util/changelog_md.py --check passes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
make pylint,make mypy,make isort)make testpasses, and a test case covers the changeWhat is the purpose of your pull request?
fix— corrects a defectfeat— adds a featureperf— changes performance, not behaviourrefactor— changes neither behaviour nor performancetest— tests onlydocs— documentation onlyci— workflows or build toolingrelease— bumps the version or rolls up a distributionchore— anything elseconst— regenerates constant or registry tables, members keeping their numeric valuesDescription of your pull request and other information
Closes #2545.
BASEinpcapkit.vendor.reg.apptype.apptype) and regenerated. The generated diff touches onlyAppType.getand one sentence ofTransportProtocol.get's docstring.AppType.get(key, default=NO_DEFAULT, *, proto=...)honours the base contract, so thetype: ignore[override]/arguments-differpair is gone. As in the base andTransportProtocol.get,defaultis a member's value, looked up in_value2member_map_, and never mints.EnumValueError, with an unchanged message, where it raised a builtinValueError.except ValueErrorstill catches it.get_alland_dispatchstill raise a builtinValueErrorfor a non-port key. That is a possible follow-up.