docs(corekit,tests): state what the enum tiers actually declare and dispatch - #997
Conversation
…ispatch Four prose defects under #719, each verified against the code rather than read off the existing text. Prose only: both files are token-identical to main with strings masked. - enum.py said the const registries "inherit them from here", of all four of get/get_all/register/register_alias. Only two are declared here: vars(EnumLookup) owns get and get_all, vars(EnumRegistry) owns register and register_alias, so the claim was transitively true at best. The prose now says which tier declares which, and that a registry reaches all four from this module. - enum.py said AppType overrides all four "to route through its _dispatch". Two of the four route through it. An AST walk of AppType's own methods finds a _dispatch call in get and get_all only; register mentions it in a docstring that explains why it deliberately does not dispatch, and apptype.py:2766-2771 gives the reason -- minting must never leak onto a transport IANA never assigned the service to. The old prose asserted the opposite of a documented design decision. The same claim one paragraph down is narrowed from "tier 2's methods" to "tier 2's lookups", since the premise is _dispatch's return value. - The tier-2 sentence covered register and register_alias with "minting", which is exact for the first and loose for the second: register_alias registers an alias rather than minting a member, and its own docstring frames the concern as a registration. It now says "a write", naming both. - Two docstring lines had drifted to 91 columns inside paragraphs otherwise wrapped at 74-82. Reflowed to their own neighbours' band; no word changed. - test_enum_lookup_reparent_930_unit.py claimed no call site in the tree had ever passed get a key of a third type. That is not statically decidable -- a key arriving through a variable is invisible to any search -- so the docstring now states what the change did establish and says why the stronger form cannot be. No citation moved, and the issue numbers left standing were each checked against the API: #842, #860, #877 and #935 are all issues. tests/corekit/{test_enum_lookup_reparent_930,test_enum_lookup_base, test_enum_lookup_reparent_877,test_enum_get_exception_provenance_923}_unit.py and tests/project/test_conventions_doc_claims.py pass: 167 passed, 1 skipped, 252 subtests, exit code 0 read from the process.
ebe6183 to
84e5035
Compare
|
GOOD TO GO at The nit was in a sentence this pull request wrote, which is why it earned a new head. The tier-2 bullet covered Reflowing that sentence also removed a pre-existing 19-column orphan tail: the paragraph now wraps 72-79 throughout. What the review verified independently, each by its own measurement rather than by reading the diff: It also established something my record had wrong. The four defects this fixes are not logged on #719 at all — they were raised on #990 (comments at 18:29Z, 18:32Z and 18:46Z today) and #992 (18:03Z), searched across 2,129 issue comments and 334 inline review comments with One observation it left for #719's accuracy half rather than acting on: Label stays |
|
Delta round: GOOD TO GO at "A write" is accurate for both methods, confirmed at the mechanism rather than the wording. The rest, each re-derived at this head: a word-level diff of the module docstring against Label is now |
Please follow the guide below
make pylint,make mypy,make isort)make testpasses, and a test case covers the changedocs/source/changelog/and regeneratedCHANGELOG.md, if the change is user-visible — N/A, centralised in docs(changelog): shared 1.5.0 changelog — long-lived, merges last (#610, #616, #617, #618, #620) #657What 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 toolingchore— anything elsePart of #719.
Description of your pull request and other information
Four prose defects in
pcapkit/corekit/enum.pyand one test docstring, each verified against the code rather than read off the existing text. Prose only: both files are token-identical tomainwithSTRINGmasked and comments dropped, and the over-95 line set is unchanged (one pre-existing line per file, at 96 and 121 columns).The "inherit them from here" claim was transitively true at best. The module docstring said the
pcapkit.constregistries inherit all four ofget/get_all/register/register_aliasfrom here. Measured:vars(EnumLookup)ownsgetandget_all;vars(EnumRegistry)ownsregisterandregister_alias. The prose now names which tier declares which, and says a registry reaches all four from this module — whichEtherTypeconfirms, all four reporting__module__ == pcapkit.corekit.enum.The
_dispatchclaim asserted the opposite of a documented design decision. The prose saidAppTypeoverrides all four "to route through its_dispatch". An AST walk ofAppType's own methods finds a_dispatchcall ingetandget_allonly — two of four.registermerely mentions_dispatchin the docstring that explains why it deliberately does not dispatch, andpcapkit/const/reg/apptype/apptype.py:2766-2771gives the reason: minting on one transport must never leak onto a transport IANA never assigned the service to. Worth noting that a naive'_dispatch' in sourcecheck reports three of four, because it matches that docstring reference — the AST walk is what separates a call from a mention.Two docstring lines had drifted to 91 columns inside paragraphs otherwise wrapped at 74-82. Reflowed to their own neighbours' band; no word changed.
test_enum_lookup_reparent_930_unit.py:634claimed a tree-wide negative that is not statically decidable — that no call site had ever passedgeta key of a third type. A key arriving through a variable is invisible to any search, so the docstring now states what the change did establish and says why the stronger form cannot be.No citation moved. The issue numbers left standing were each type-checked against the API: #842, #860, #877 and #935 are all issues.
tests/corekit/{test_enum_lookup_reparent_930,test_enum_lookup_base,test_enum_lookup_reparent_877,test_enum_get_exception_provenance_923}_unit.pyandtests/project/test_conventions_doc_claims.pypass — 167 passed, 1 skipped, 252 subtests, exit code 0 read from the process rather than a summary line.