fix(protocols): widen the two kept get overrides in mh.py to accept default - #940
Conversation
|
NEEDS CHANGES at
Confirmed otherwise, and the verification was thorough enough to be worth naming: a 10-case × 4-class matrix (name hit/miss ± usable and unusable default, The module-purge alibi holds, tested rather than assumed: running Two pre-existing findings, out of scope here — I will track them rather than widen this PR:
Also worth fixing while in there: the new |
2bdf69b to
c230bb5
Compare
|
GOOD TO GO at The delta from the reviewed head The docstring now states both halves correctly, The Standing on the Opus review at Two follow-ups I am tracking rather than folding in, both pre-existing and measured on the pure re-parents too, so neither is a divergence this PR introduces:
Unpublished and awaiting you. #939 also edits |
|
why must we have the two overrides tho? cant they directly fall back to the base class's? |
|
New question recorded, verbatim:
Measured, and the answer is: they can — after this PR they are behaviourally redundant. Comparing There is exactly one input where they differ, and the override is the worse of the two. Non- The override branches on Nothing else is holding them up. No aliases exist on either — So the honest answer is that #935 solved the wrong problem: widening the signatures makes them faithful copies of the base rather than removing the duplication, and I should have asked your question before dispatching the work. Two options, and I would take the second:
The one thing to confirm before (2): whether anything calls these with a non- |
|
I prefer (2) directly. |
|
Ruling recorded, verbatim:
So option 2: delete both What that buys, all measured before you ruled: the two The evidence it is safe: zero behavioural difference from the base across nine cases per class (name hit/miss, value hit/miss, every Dispatching the rewrite now. The PR keeps its number and branch; the diff inverts from +321/-62 to a deletion, and the two tests added for the widening get repointed at the inherited behaviour instead — including one that pins
|
b674fd0 to
18066ff
Compare
…he base FastBindingAcknowledgmentStatus.get and IPv6AddressPrefixCode.get were re-parented onto EnumLookup by #932, which made them advertise the base's two-argument get(key, default) through inheritance while their own @staticmethod overrides still only accepted one. #935's first ruling widened both signatures to accept default; asked next "why must we have the two overrides tho? cant they directly fall back to the base class's?", the owner's final ruling went further, verbatim: "I prefer (2) directly" -- delete both overrides outright. - Delete both get() methods. Neither minted an alias (__members__ and list(cls) already agreed at 6 and 4), so "Backport support for original codes" was just the int-or-name dual resolution the base already provides; all 20 call sites (all in tests) passed only an int or a str. Both classes now inherit get/get_all from the base, the same as the five other re-parents. - Remove both `# type: ignore[override] # pylint: disable=arguments-differ` suppressions along with the methods -- absent now, not silenced. NO_DEFAULT and EnumKeyError drop out of the imports, unused once the methods that referenced them are gone. - Behaviour change, deliberate: the overrides branched on isinstance(key, int) and misrouted every other type through the name path, so get(None)/get(1.5) answered with a quiet EnumKeyError here against a loud EnumValueError on the other five. Deleting them makes all seven answer alike for the first time. - tests/corekit/test_enum_lookup_reparent_930_unit.py: drop the staticmethod pin in ReparentedBasesTests (nothing left to decorate); rename KeptOverrideQuietnessTests to InheritedQuietnessTests and PureReparentClassmethodTests to AllSevenInheritTheBareClassmethodTests, extended to all seven; add NonCanonicalKeyConvergenceTests pinning the get(None)/get(1.5) convergence. - tests/protocols/internet/test_mh_unit.py: repoint the default-widening test into one proving default now works uniformly across all four of this module's EnumLookup classes through the single inherited method. Verified: mypy 321 errors/38 files and pylint 8.67/10 (exit 30) both unchanged against 3823758 (the two mh.py pylint findings that do disappear are the two now-deleted f-string-eligible raises); the two [override] errors are absent rather than suppressed. All three target test modules pass individually; the new convergence and uniformity tests both fail against 3823758 and pass here.
af985ee to
4254183
Compare
|
GOOD TO GO at Per your ruling "I prefer (2) directly.", both
The incident, reported by the worker and independently checked by me. A merge of I did not take "nothing was lost" on trust. Unpublished and awaiting you. #935 solved the wrong problem and your question caught it — the redundancy was visible in the diff I had already granted good-to-go, and I should have asked before dispatching the widening. |
…#934) Part B of #934: the remaining nitpicky sphinx-build misses in conventions.rst that are neither the sentinels module refs part A (#936) fixed nor the six aenum roles part C already ruled on (plain literals, since aenum's objects.inv carries zero py: objects and conf.py excludes it deliberately). * Qualified the three unqualified sentinel refs -- :class:`AbsentType`, :class:`NoValueType` and :data:`ABSENT` -- to their real dotted path under pcapkit.corekit.sentinels, so they resolve against the page #936 added. Rewrapped the two lines that grew past this file's ~88-column convention; no wording changed. * Added an autoclass entry for FEATCode to docs/source/pcapkit/const/ftp.rst, and widened the FTP Command section's intro clause to name both classes it now documents -- FEATCode is a companion of Command's, not a peer listed in the page's own overview table, so it stays folded into that section rather than getting its own heading; every other section in this file pairs one heading with one autoclass, and inventing a repeated `.. module::` for a second heading on the same submodule would be a novel shape this file has nowhere else. * Demoted Method.get and part C's six aenum roles to plain double-backtick literals: Method.get carries `:meta private:` deliberately (same pattern as Command.get, OptionType's and AppType's private get overrides), and aenum cannot be cross-referenced at all, so no target can exist for either. * Rebasing onto #940 (merged after this branch started) surfaced a seventh broken reference: #940 deleted FastBindingAcknowledgmentStatus.get outright rather than just widening it, so the :meth: role citing it in the #923 retrospective joined the unresolved set. Demoted to a plain literal too, matching the two sibling examples already written that way in the same sentence (TransportProtocol.get, Criticality.get). * Added test_ftp_featcode_doc_page_934_unit.py, pinning the new autoclass entry the way test_sentinels_doc_page_934_unit.py pins part A's page; proven to fail against the pre-fix (83c7552) page. * Added AenumRoleExclusionTests to test_conventions_doc_claims.py: pins that no :mod:/:class:/etc. role names aenum on this page (the plain-literal demotion is settled policy per conf.py, and nothing else enforced it), and that the four qualified sentinel targets stay qualified. Both assertions proven to fail against the pre-fix (83c7552) page. Nitpicky sphinx-build: conventions.rst had 14 unresolved references against 83c7552, 15 against b337cdb (this branch's rebased base) once #940's deletion is counted; all resolve here. Three more resolve as a side effect of documenting FEATCode: stale FEATCode references inside Command._unregistered_member's and Method._unregistered_member's own docstrings, plus one in a rendered `feat: Optional[FEATCode]` parameter annotation with no clear file attribution. Two pre-existing bugs inside FEATCode's own docstring are newly exposed rather than introduced -- a line-wrapped :meth: role and a reference to the vendor Command.process, deliberately excluded from vendor/ftp.rst's own :members: allowlist. FEATCode's :show-inheritance: does genuinely introduce one new warning of its own (an aenum._enum.StrEnum base that cannot resolve), joining five identical ones already present for Command/Method/etc. Recording rather than fixing any of these: out of scope for this file. mypy 321 errors/38 files, pylint 8.67/10 exit 30, isort clean -- all matching the b337cdb baseline (R0401 cyclic-import churn aside, which is non-deterministic on an unmodified tree). Targeted tests: 40 passed, 1 skipped across test_conventions_doc_claims (incl. the two new AenumRoleExclusionTests methods), test_sentinel_exports_unit, test_sentinels_doc_page_934_unit and the FEATCode page test.
…s page (#918) Part 1 of #918: the rulings that settled what a ``get`` override owes ``EnumLookup.get`` lived only in issue and PR comments, where nothing keeps them findable. Part 2 split ``conventions.rst`` into a page per anchor so they have somewhere to land; this writes them onto the registry-protocol page. - Add *What a ``get`` Override May and May Not Do*, carrying the three rulings (#933 on ``quiet=True``, #935 on honouring an advertised signature rather than suppressing it, #940 on deleting an override that only reimplements the base) plus the ``@classmethod`` requirement, which is a language constraint rather than a ruling. Each is recorded with the reasoning, not the outcome: the code already encodes the outcome, and the reasoning is what is expensive to rediscover. - State the ``@classmethod`` constraint from measurement. Zero-argument ``super()`` binds the enclosing function's **first positional parameter**, whatever its name, so in ``@staticmethod def get(key, ...)`` it binds the lookup key and raises ``TypeError: super(type, obj): obj (instance of str) is not an instance or subtype of type (...)``. ``RuntimeError: super(): no arguments`` is a different failure, reachable only when the function takes no parameters at all -- which no real ``get`` override does. And the ``TypeError`` is not guaranteed: an instance first argument delegates **silently**, so a ``@staticmethod`` override cannot be relied on to fail loudly at all. - Correct the audit row #940 falsified. It claimed **two** of the ``mh.py``/``ngap.py`` group define a ``get`` of their own; #940 deleted both, so the count is now none. That row rendered fine and failed nothing while naming methods that no longer exist. - Extend ``tests/project/test_conventions_doc_claims.py`` with ``GetOverrideContractTests``: four tests, ten subtests, each pinning both the page's wording and the tree it describes. The ``@classmethod`` test now **executes** all three ``super()`` outcomes against purpose-built classes rather than grepping the page for an error string -- a prose-only assertion is what let the wrong exception stand in the first place. The ``sys.tracebacklimit`` test runs its behavioural check unconditionally instead of skipping it when the attribute is already set, which had made it degrade to a doc-text check that still reported pass. tests/project: 210 passed, 1 skipped, 572 subtests. Each new assertion was shown to fail with its claim removed, and the tracebacklimit check verified to run -- and restore prior state -- with ``sys.tracebacklimit`` pre-set.
…s page (#918) Part 1 of #918: the rulings that settled what a ``get`` override owes ``EnumLookup.get`` lived only in issue and PR comments, where nothing keeps them findable. Part 2 split ``conventions.rst`` into a page per anchor so they have somewhere to land; this writes them onto the registry-protocol page. - Add *What a ``get`` Override May and May Not Do*, carrying the three rulings (#933 on ``quiet=True``, #935 on honouring an advertised signature rather than suppressing it, #940 on deleting an override that only reimplements the base) plus the ``@classmethod`` requirement, which is a language constraint rather than a ruling. Each is recorded with the reasoning, not the outcome: the code already encodes the outcome, and the reasoning is what is expensive to rediscover. - Paraphrase the rulings rather than block-quoting the maintainer, per his request on #918, and pin the page's *claim* in the tests instead of his wording. Quoting him verbatim had made an off-hand reply load-bearing in CI: an assertion required the literal ``I prefer (2) directly.`` to appear on a docs page. The quotes that predate this change are tracked in #949. - State the ``@classmethod`` constraint from measurement, on every supported version. Zero-argument ``super()`` binds the enclosing function's **first positional parameter**, whatever its name, so in ``@staticmethod def get(key, ...)`` it binds the lookup key and raises ``TypeError``. CPython words that error differently either side of 3.13 -- ``obj must be an instance or subtype of type`` on 3.10-3.12, ``obj (instance of str) is not an instance or subtype of type (Cls)`` on 3.13+ -- so the page shows both and the test asserts only ``instance or subtype of type``, which is common to them. Pinning either full sentence passes on two of the five required Compat legs and fails the other three, invisibly, since this venv is 3.14. - Record the two corollaries that make the obvious summary wrong in both directions: ``RuntimeError: super(): no arguments`` needs a function with no parameters at all, which no real override has; and an instance first argument makes the delegation **succeed silently**, so a ``@staticmethod`` override cannot be relied on to fail loudly. - Correct the audit row #940 falsified. It claimed **two** of the ``mh.py``/``ngap.py`` group define a ``get`` of their own; #940 deleted both, so the count is now none. That row rendered fine and failed nothing while naming methods that no longer exist. - Extend ``tests/project/test_conventions_doc_claims.py`` with ``GetOverrideContractTests``: four tests, ten subtests. The ``@classmethod`` test **executes** all three ``super()`` outcomes rather than grepping the page for an error string -- a prose-only assertion is what let a wrong exception stand. The ``sys.tracebacklimit`` test runs its behavioural check unconditionally instead of skipping it when the attribute is already set, which had made it degrade to a doc-text check that still reported pass. tests/project: 210 passed, 1 skipped, 572 subtests. Each new assertion was shown to fail with its claim removed; the tracebacklimit check verified to run, fail when the base raises loudly, and restore prior state with ``sys.tracebacklimit`` pre-set; and the ``TypeError`` wording measured on 3.10 through 3.14.
… wording (#949) The convention pages recorded design rulings by block-quoting the maintainer verbatim, and several tests asserted those sentences as literal strings -- so a casual reply in a thread was a CI build dependency. * Paraphrase all verbatim quotes across the five convention pages and the two ``pyproject.toml`` comment blocks, keeping attribution by issue number. Spec quotations (RFC/IANA) and the package's own cited docstring stay verbatim, since those words are normative. * Replace the assertions that pinned his sentences with ones that derive the claim from the tree: the seven audit population figures, the ``R1_Counter``/``R1_COUNTER`` values executed through ``Parameter.get``, and a stray-registry check. * Guard ``vars(Method)['get']`` and its two siblings with a membership check, so folding an override into the base reports an ``AssertionError`` naming the cause instead of a bare ``KeyError`` -- the shape #940 created. Deliberately not under ``subTest``, which would record the failure and let the bare ``KeyError`` be raised anyway by the indexing below it. * Rebuild the dependabot label assertion as a derivation from ``package-ecosystem`` in ``dependabot.yml``, replacing a single-phrasing ``assertNotIn`` that a reworded violation walked straight past. Every clause matching the shape is checked, not just the first. ``pytest tests/project``: 225 passed, 1 skipped, 667 subtests, 0 failed.
… wording (#949) The convention pages recorded design rulings by block-quoting the maintainer verbatim, and several tests asserted those sentences as literal strings -- so a casual reply in a thread was a CI build dependency. * Paraphrase all verbatim quotes across the five convention pages and the two ``pyproject.toml`` comment blocks, keeping attribution by issue number. Spec quotations (RFC/IANA) and the package's own cited docstring stay verbatim, since those words are normative. * Replace the assertions that pinned his sentences with ones that derive the claim from the tree: the seven audit population figures, the ``R1_Counter``/``R1_COUNTER`` values executed through ``Parameter.get``, and a stray-registry check. * Guard ``vars(Method)['get']`` and its two siblings with a membership check, so folding an override into the base reports an ``AssertionError`` naming the cause instead of a bare ``KeyError`` -- the shape #940 created. Deliberately not under ``subTest``, which would record the failure and let the bare ``KeyError`` be raised anyway by the indexing below it. * Rebuild the dependabot label assertion as a derivation from ``package-ecosystem`` in ``dependabot.yml``, replacing a single-phrasing ``assertNotIn`` that a reworded violation walked straight past. Every clause matching the shape is checked, not just the first. * ``tests/corekit/test_sentinel_exports_unit.py`` asserted the literal ``ONLY`` -- the maintainer's capitalisation, lifted from inside the #911 block quote this change paraphrases. It now checks the export boundary against ``pcapkit.corekit.sentinels.__all__`` and requires only the identifier and the issue number on the page. ``pytest tests/project``: 225 passed, 1 skipped, 667 subtests, 0 failed. ``tests/corekit`` doc-reading files: 61 passed, 96 subtests, 0 failed.
#719 Swept tests/ for owner-ruling quotes attributed to the wrong GitHub thread, the same defect class #719 fixed under pcapkit/. Confirmed each by grepping the quote's distinctive text against the cited thread's body/comments; a hit elsewhere is a re-quote or a different thread's own words, not the source. - test_sentinel_exports_unit.py: the already-reported #937->#719 fix for AbsentType's privacy ruling. - test_enum_lookup_reparent_930_unit.py (4 sites) and test_mh_unit.py: "I prefer (2) directly" and the question that drew it are in pull request #940's thread, not issue #935 -- #935 only carries the first ruling ("I lean on 1"). - test_vendor_snapshot_restore_unit.py: the contextlib/atomic-write ruling is in pull request #873's thread; issue #872 has zero comments. - test_vendor_reg_apptype_generator_unit.py (2 sites): the "undefined direct uses 0" ruling is in pull request #874's thread, not issue #860 or #770. - test_const_enum_no_mint.py (2 sites): the mint/unmint criterion was settled on pull request #847 and confirmed on #775 -- the reverse of what the text said, per #861's own description of the same ruling; and "Q1 - bare it is." is pull request #838's thread, not #775's. One occurrence left unresolved rather than guessed at: the "Preserve each branch's existing name argument..." quote (4 sites in test_const_enum_no_mint.py, attributed to "#775's final round") does not appear verbatim in #775, #847, or #878 (the implementing PR) by body, comments, review comments, or commit message -- only a paraphrase in #878's own PR description/commit message, which is the author's prose rather than a quoted ruling. Flagged for the owner rather than fixed. tests/corekit/, tests/vendor/, tests/const/ pass (400/16, 118, 299 respectively, pcapkit.__file__ confirmed inside this worktree); tests/protocols/internet/test_mh_unit.py passes standalone (52/0) -- the full directory has 5 unrelated pre-existing failures from ungenerated examples/captures/ fixtures, untouched by this change. Refs #719
…719) Per #719's citation ruling (de-quote, never reproduce a verbatim quote that may have come from outside GitHub): - test_const_enum_no_mint.py (4 sites): a quotation attributed to "the owner's ruling, verbatim" never appears in #775, #847, #861 or #878 (or anywhere in the repo's comment corpus). Replaced with a paraphrase attributed to PR #878's own body, which carries the real design note in different words. - test_sentinel_exports_unit.py / test_const_registry_protocol.py: a quote attributed to #911 silently dropped half of what the owner wrote on #719 and swapped `__all__` for "users". Replaced with a paraphrase naming #719 as where it was settled and #911 as the issue that carried it out. - test_const_enum_no_mint.py / test_const_enum_builtin_parity.py (4 sites): a "verbatim" quote of #860 silently corrected the owner's typo ("entires" -> "entries"). Paraphrased, which drops the question of reproducing or flagging the typo. - test_enum_lookup_reparent_930_unit.py: "the owner's final ruling there" had #935 as its nearest antecedent instead of #940; named #940 explicitly and paraphrased the adjacent quote. Verified: ast.parse and reST markup pairing clean on every touched file; tests/const (299 tests) and the targeted pytest sweep of all touched files (261 passed, 2013 subtests) are green. tests/corekit's full discover run shows 5 pre-existing failures in test_sentinel_exports_unit.py, confirmed identical on the unedited originals -- a cross-file test-order dependency unrelated to this change.
…quest (#719) (#982) * docs(pcapkit,ci): cite the issue a defect belongs to, not the pull request (#719) Per the owner's ruling on #719, replace every reference to a pull-request number in pcapkit/** and .github/workflows/** comments and docstrings with the issue it closed, or a description where no issue covers it. - 92 real PR citations in pcapkit/ (93 was the estimate; the gap is RFC packet-diagram and hex-format-spec false positives, plus one cross-repo issue citation that only coincidentally matched a PyPCAPKit PR number). - 13 PR citations in .github/workflows/, matching the estimate exactly. - Several citations named two or three numbers for one claim where a PR closed several issues, or several PRs closed the same issue; deduplicated rather than left reading "#425 and #425". Four review rounds caught the same category error recurring: several sites had relocated a verbatim quote or a specific finding into the issue number rather than describing where the ruling was actually given, so the quote no longer existed where the sentence pointed. Fixed each by naming the issue while locating the ruling honestly -- "a ruling given in review of the work for #N" -- the same shape already used on this repo's conventions docs. Two sites needed the inverse correction instead: the #923 quote in enum.py/exceptions.py genuinely is recorded on #923's own thread, just attributed there to the pull request that implemented it, so those read "a ruling recorded on GitHub issue #923" rather than pointing elsewhere. Also fixed a lost conjunction and an ordinal/number mismatch in corekit/enum.py, a self-contradicting below/above pointer repeated across three internet/ files, and a number collision in http.py where one issue ended up naming both a defect and the change that closed it. Final sweep: grepped the whole tree for the word "verbatim" -- the marker that makes a quote-attribution claim falsifiable -- across all 30 files under pcapkit/ that carry it, and checked every quote this way names against the actual issue thread. Caught two more of the same defect: vendor/__main__.py's #872 citation (the quote is in the implementing pull request's review, not #872 itself) and four sites across mh.py attributing to #935 a ruling that only exists in the review of the pull request that implemented it -- #935's own thread holds just the superseded widen-not-delete proposal. Both fixed the same way. Every other quote-bearing claim the sweep found -- #911, #937, three distinct #877 quotes, both #842 quotes, and the #860/#808/#806/#886/#917 rewrites from earlier in this pass -- resolves to the thread it names. Verified: targeted pytest across every touched module passes, including the test that pins the vendor/const apptype.py get() region as byte-identical, reconfirmed after each amendment. Both edited workflow YAML files parse before and after with unchanged key counts. * docs(corekit): cite #719, not #937, for the AbsentType ruling AbsentType's docstring attributed the owner's "document it as private type/class... not for public use is enough" quote to #937. #937 itself quotes that ruling verbatim under "The owner's ruling, verbatim (from #719)" -- it re-attributes rather than originates it. Per the house rule to cite the issue a ruling was settled on (docs/source/contributing/conventions/documentation.rst:196-200), point the attribution at #719 and re-wrap the paragraph to the file's existing ~78-column width. The neighbouring, unrelated #937 citation describing what #937 did to sentinel naming is untouched. tests/corekit/ passes (400 passed, 16 skipped) against this worktree's own pcapkit (confirmed via pcapkit.__file__); pylint on the file is 9.77/10, unchanged by this edit -- the one finding is a pre-existing, unrelated too-few-public-methods warning on NoValueType. * docs(tests): re-point six ruling citations at their actual threads, per #719 Swept tests/ for owner-ruling quotes attributed to the wrong GitHub thread, the same defect class #719 fixed under pcapkit/. Confirmed each by grepping the quote's distinctive text against the cited thread's body/comments; a hit elsewhere is a re-quote or a different thread's own words, not the source. - test_sentinel_exports_unit.py: the already-reported #937->#719 fix for AbsentType's privacy ruling. - test_enum_lookup_reparent_930_unit.py (4 sites) and test_mh_unit.py: "I prefer (2) directly" and the question that drew it are in pull request #940's thread, not issue #935 -- #935 only carries the first ruling ("I lean on 1"). - test_vendor_snapshot_restore_unit.py: the contextlib/atomic-write ruling is in pull request #873's thread; issue #872 has zero comments. - test_vendor_reg_apptype_generator_unit.py (2 sites): the "undefined direct uses 0" ruling is in pull request #874's thread, not issue #860 or #770. - test_const_enum_no_mint.py (2 sites): the mint/unmint criterion was settled on pull request #847 and confirmed on #775 -- the reverse of what the text said, per #861's own description of the same ruling; and "Q1 - bare it is." is pull request #838's thread, not #775's. One occurrence left unresolved rather than guessed at: the "Preserve each branch's existing name argument..." quote (4 sites in test_const_enum_no_mint.py, attributed to "#775's final round") does not appear verbatim in #775, #847, or #878 (the implementing PR) by body, comments, review comments, or commit message -- only a paraphrase in #878's own PR description/commit message, which is the author's prose rather than a quoted ruling. Flagged for the owner rather than fixed. tests/corekit/, tests/vendor/, tests/const/ pass (400/16, 118, 299 respectively, pcapkit.__file__ confirmed inside this worktree); tests/protocols/internet/test_mh_unit.py passes standalone (52/0) -- the full directory has 5 unrelated pre-existing failures from ungenerated examples/captures/ fixtures, untouched by this change. Refs #719 * docs(tests): paraphrase four fabricated or altered owner quotations (#719) Per #719's citation ruling (de-quote, never reproduce a verbatim quote that may have come from outside GitHub): - test_const_enum_no_mint.py (4 sites): a quotation attributed to "the owner's ruling, verbatim" never appears in #775, #847, #861 or #878 (or anywhere in the repo's comment corpus). Replaced with a paraphrase attributed to PR #878's own body, which carries the real design note in different words. - test_sentinel_exports_unit.py / test_const_registry_protocol.py: a quote attributed to #911 silently dropped half of what the owner wrote on #719 and swapped `__all__` for "users". Replaced with a paraphrase naming #719 as where it was settled and #911 as the issue that carried it out. - test_const_enum_no_mint.py / test_const_enum_builtin_parity.py (4 sites): a "verbatim" quote of #860 silently corrected the owner's typo ("entires" -> "entries"). Paraphrased, which drops the question of reproducing or flagging the typo. - test_enum_lookup_reparent_930_unit.py: "the owner's final ruling there" had #935 as its nearest antecedent instead of #940; named #940 explicitly and paraphrased the adjacent quote. Verified: ast.parse and reST markup pairing clean on every touched file; tests/const (299 tests) and the targeted pytest sweep of all touched files (261 passed, 2013 subtests) are green. tests/corekit's full discover run shows 5 pre-existing failures in test_sentinel_exports_unit.py, confirmed identical on the unedited originals -- a cross-file test-order dependency unrelated to this change. * test(vendor,corekit): fix a surviving fabricated ruling and a wrong citation (#719) - tests/vendor/test_ipx_socket_unit.py: the "owner's ruling" attribution for keeping the hex-suffixed Xerox name survived in this file after the prior commit removed the same false attribution from four sites in test_const_enum_no_mint.py. Reworded to credit PR #878's own design note, matching the wording already used at the repaired sites. - tests/corekit/test_sentinel_exports_unit.py: the docstring cited the #719 export ruling ("only export objects, not types") as grounds for keeping ABSENT out of __all__, but ABSENT is an object, so that ruling argues for including it, not excluding it. Re-grounded the sentence on the privacy ruling already quoted ~15 lines below instead, without re-quoting it. Both changes are prose-only: tokenizing each file before and after with comments and docstrings stripped produces identical token sequences. tests/vendor passes 118/118 except one pre-existing, test-order-dependent flake in test_vendor_snapshot_restore_unit.py (reproduces identically on the pre-edit tree); tests/project/test_conventions_doc_claims.py passes 38/38. * test(corekit,const): narrow the blanket paraphrase, restoring quotations that cite correctly (#719) The last two commits paraphrased every disputed owner quotation away. That was right for one case and wrong for two: a quotation that exists nowhere has to be paraphrased, but a quotation that is real and was only cited to the wrong thread lost its audit trail for nothing, since the defect was the pointer, not the words. Per the owner's ruling, narrow the fix to match. Restored as quotations, correctly cited: - tests/corekit/test_sentinel_exports_unit.py (~L4-7) and tests/const/test_const_registry_protocol.py (~L1363): the sentinel export rule, split back into its two real sources instead of one spliced sentence -- #719's "we should ONLY export the objects ... and leave the types ... out", and #911's own "we only expose the final objects to users", with #911 noted as both executor and source. - tests/const/test_const_enum_no_mint.py (~L88, ~L1876, ~L2363) and tests/const/test_const_enum_builtin_parity.py (~L655): the #860 minting ruling, including its load-bearing first sentence ("I think we should not mint on get still actually") and the owner's own "entires" typo, marked [sic] rather than silently corrected. Left alone: the four #878 fabricated-quote sites in test_const_enum_no_mint.py, which cite no real thread and stay paraphrased, and the ABSENT privacy sentence, which is a correct paraphrase of a different ruling. Verified: ast.parse and reST markup clean on all four files; code token sequences (docstrings/comments stripped) identical before and after; each restored quotation substring-matches its source comment after whitespace/markup normalisation. tests/const: 299 OK. tests/ project/test_conventions_doc_claims: 38 OK, 1 skipped. * test(corekit,const): convert restored quotations to statements with context, per #719 The previous commit restored eight verbatim quotations to fix a narrowing that had dropped their context. The owner has since ruled that neither form is right: a narrowed paraphrase without context does not help a reader who was not in the thread, but a verbatim quotation makes the docstring read as a discussion rather than documentation. - Sentinel export rule (corekit/test_sentinel_exports_unit.py, const/test_const_registry_protocol.py): state that a module's `__all__` lists a sentinel's object but deliberately leaves its type out, and why (the type is not part of the public surface), citing #719 as where it was settled and #911 as where the implementing work belongs. - #860 minting rule, four sites (const/test_const_enum_no_mint.py x3, const/test_const_enum_builtin_parity.py): state that `get()` must not mint and only `register()` creates a new entry, and why (only IANA-registered values are legitimate and `get()` lacks the information to construct one), citing #860. Each site is fitted to its own surrounding prose rather than one paragraph pasted four times. Drops the `[sic]` each quotation carried, since there is nothing left to reproduce. - Fixed two sentences left orphaned by the quotations' removal: an antecedent ("the three") that depended on the deleted quote's wording, and a sentence whose "get() as well as _missing_" had the emphasis backwards relative to the rule's own subject. The four PR #878 paraphrase sites in test_const_enum_no_mint.py were already in this third form and are unchanged. Verified: ast.parse on all four files; tokenize with comments and docstrings stripped shows an identical token sequence before/after (prose-only); tests/const (299) and tests/project/test_conventions_doc_claims.py (38, 1 skip) pass; tests/corekit (400, 5 failures, 16 skipped) matches the documented pre-existing sentinel-identity failures. * test(corekit,const): state the remaining owner rulings in our own words, per #719 The four files still carried owner-attributed quotations beside the eight converted earlier, so each read half as documentation and half as a thread. - Replace each quoted ruling with a statement of the rule, the reason a reader needs, and the issue where it was given (#842, #864, #775, #860, #911, #719, #647, #808, #759, #857). - Rename the dangling "privacy ruling quoted below" reference to point at the statement that replaced the quotation. - Leave RFC text, code literals and ordinary prose untouched. Prose only: tokens with comments and docstrings stripped are identical before and after; tests/const 299 OK, tests/corekit unchanged (5 known). * test(const): restore ruling citations to the pull requests that carry them, per #719 tests/ is exempt from the issue-citation rule (documentation.rst, ruled on #719): the fact cited lives in the pull request, not the issue. - PR #836 restored for the TransportProtocol-extension refusal, the |-composite decoding retirement, and the stale-comment deletion; the rulings are not on #808 at all. - PR #783 for the f-string convention; PR #847 for the mint criterion. - The de-quotation stands: wording stays as statements, no quotation marks.
The cross-review on #992 found six maintainer quotations surviving in tests/corekit/test_enum_lookup_reparent_930_unit.py, one pair inside the very docstring whose second paragraph the first pass had already converted -- so a single __doc__ showed both forms fifteen lines apart. The first pass implemented #987's remainder list rather than measuring. That list said two "I prefer (2) directly" quotations; grep over main gives three, at lines 33, 202 and 454, and only the last two were converted. The issue body is corrected, and the scan this time sets no minimum span length -- one of the six was two characters long and a length filter is what hid it. - The #935 lean and the two #940 quotations at :29-33 become one statement of what each settled, keeping the pull-request citation. - #933's reversal is paraphrased differently at the two sites that draw on it, because they make different points: the module docstring takes what the ruling settled, while the class docstring takes why an earlier revision of this file had pinned the opposite. - The prose said the follow-up came four minutes after the first answer. The comments are 21:32:21Z and 21:37:17Z, so 4m56s; now "a few minutes later", which is what the evidence carries. The pull-request citations stay. tests/ is exempt from the name-the-issue rule per docs/source/contributing/conventions/documentation.rst:203, but that exemption does not reach the no-verbatim rule at :184, which has no carve-out. Prose only: token sequences identical with strings masked, both differing string tokens are docstrings, the AST with docstrings blanked compares equal, and maximum line length stays 121. A re-scan finds zero maintainer quotations.
The cross-review on #992 found six maintainer quotations surviving in tests/corekit/test_enum_lookup_reparent_930_unit.py, one pair inside the very docstring whose second paragraph the first pass had already converted -- so a single __doc__ showed both forms fifteen lines apart. The first pass implemented #987's remainder list rather than measuring. That list said two "I prefer (2) directly" quotations; grep over main gives three, at lines 33, 202 and 454, and only the last two were converted. The issue body is corrected, and the scan this time sets no minimum span length -- one of the six was two characters long and a length filter is what hid it. - The #935 lean and the two #940 quotations at :29-33 become one statement of what each settled, keeping the pull-request citation. - #933's reversal is paraphrased differently at the two sites that draw on it, because they make different points: the module docstring takes what the ruling settled, while the class docstring takes why an earlier revision of this file had pinned the opposite. - The prose said the follow-up came four minutes after the first answer. The comments are 21:32:21Z and 21:37:17Z, so 4m56s; now "a few minutes later", which is what the evidence carries. The pull-request citations stay. tests/ is exempt from the name-the-issue rule per docs/source/contributing/conventions/documentation.rst:203, but that exemption does not reach the no-verbatim rule at :184, which has no carve-out. Prose only: token sequences identical with strings masked, both differing string tokens are docstrings, the AST with docstrings blanked compares equal, and maximum line length stays 121. A re-scan finds zero maintainer quotations.
Round 3's review found the previous round had replaced a true sentence with a false one. Splitting the two measurements was right -- the alias comparison is provably pre-ruling, the 20-call-site grep only provably pre-acting -- but "Checked when acting on it" asserts an ordering #940 contradicts: - 01:57:57Z the grep is promised, unconditionally, to be reported before anything is touched; - 02:00:58Z the ruling lands; - 02:01:29Z one comment carries both the grep's result and the announcement that the rewrite is being dispatched. Result and dispatch in the same comment, so the check preceded the acting on every reading: if the grep ran in the three-minute wait it was before the ruling too, and if it ran in the following 31 seconds it still preceded the dispatch. The base text had said "Measured before acting on that final ruling" across both halves, which was accurate for both. - "when acting on it" becomes "before acting on it", keeping the split. - Re-flow the paragraph at 91 columns. One line had been left at 107 where its neighbours run 73-91, the residue of a 179-character line caught mid-edit that came back under the limit without the paragraph being re-wrapped. Lines over 95 characters go from two to one, and the survivor is pre-existing. Prose only: token sequences identical with strings masked, both differing string tokens are docstrings, the AST with docstrings blanked compares equal, and maximum line length stays 121.
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 defectDescription of your pull request and other information
Fixes #935.
FastBindingAcknowledgmentStatus.getandIPv6AddressPrefixCode.getwere re-parented ontoEnumLookupby #932, which made them advertise the base's two-argumentget(key, default)through inheritance while their own kept@staticmethodoverrides still only accepted one —default=raisedTypeErrorinstead of the base's own fallback.Per the owner's ruling on #935 ("I lean on 1"), both signatures now widen to
get(key, default=NO_DEFAULT)and resolvedefaultthrough_value2member_map_, matching the base's contract exactly — deliberately not through the constructor already used forkey, since that constructor's own miss path (_missing_) raises loud and would pollutesys.tracebacklimitprocess-wide even on a miss this method answers quietly (the #362 hazard). This removes the two# type: ignore[override] # pylint: disable=arguments-differsuppressions the old signature mismatch needed; a narrow# type: ignore[misc]covers the four_value2member_map_reads instead, since that attribute is generic overSelfand reading it through a bare class reference (nocls— the@staticmethodis kept) is whatmypyflags ambiguous.Verified against
382375811:mypy(321 errors/38 files) andpylint(8.67/10, exit 30) are unchanged, with the two former[override]errors now gone;isortclean. New tests in both owned test files prove theTypeErroris fixed,defaultis honoured exactly like the five pure re-parents, and the quiet raise (#933) still holds on the widened path.