Repository navigation
Make bool(MatchResult) raise, name the method in Matching's non-name error, and say what a suggestion promises across releases - #1403
Merged
Conversation
…error, and say what a suggestion promises across releases A MatchResult defined no __bool__, so `if matcher.check(a, b):` took the branch on a conflict. It now raises TypeError naming `.consistent`. Matching.keys refused a non-name as "check takes ..."; the shared _parsed names the method called. docs/suggest.rst and Suggestion's docstring say a suggestion is one release's answer, so a caller keeps the settings applied. Decisions entries in name-matching (TRUTH VALUE) and group-suggestion (ACROSS RELEASES), both 2026-11-15. Co-Authored-By: Claude Fable 5.2 <[email protected]>
decisions/group-suggestion: the "Proposed, for review" lead leaves the twelve Standing bullets, the marker on eleven entry heads points at a new 2026-11-15 ACCEPTED entry, and SCOPE's closing sentence says the rest of the file was proposed. Root AGENTS.md's design philosophy says the suggester's scope is decided. No code changes. Co-Authored-By: Claude Fable 5.2 <[email protected]>
… spelling, and the decisions entries' claims narrowed check() and keys() tell bytes to decode first, as parse() does. The truth-value test holds the message to the spelling mypy checks. The unlinked suggest-across-releases label goes. decisions: TRUTH VALUE records that rows and outcomes stay truthy, undecided; ACROSS RELEASES narrows its Standing line and its Why to what the entries show; ACCEPTED says #1355's reach is a decision now and counts its heads right; each new entry cites the PR. Co-Authored-By: Claude Fable 5.2 <[email protected]>
… count Second-round review of #1403: the reach decided is the part the Standing statement words; the heads count names its population; ACROSS RELEASES' Decided bullet names signals beside tables and thresholds. Co-Authored-By: Claude Fable 5.2 <[email protected]>
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.
Three changes from the API review before the 3.1 release. Matching and the suggester have shipped in no release, so none of this moves a released behaviour.
1.
bool(MatchResult)raisesA
MatchResultdefined no__bool__, so it was true for every pair:if matcher.check("John Smith", "Mary Jones"):took the branch on a conflict.MatchResult.__bool__now raisesTypeError:Decided: raise, not return
consistent. Shipping a truth value and changing it later would be a behaviour change; no working code depends on an exception, so raising keeps both open (decisions/name-matching, the name-matching decisions file, 2026-11-15 TRUTH VALUE).Truthiness sites changed: none. Nothing in the library, tests, tools or docs relied on a result's truth value. Checked by the full suite with
__bool__raising (everyasserton a result already read.consistentor compared with==), both Sphinx builds,python -m doctest README.rst, and a read of every.check(outsidetests/v2/test_match.py(tools/differential/match_diff.pyreadsr.consistent;tests/v2/test_parser.py,test_locales.pyandtest_familiar_tool.pyread.consistent).Tests: it raises on
bool,not,and, a conditional,anyandfilter, for a consistent and a conflicting result; the offered code runs;==,!=,hash, set and list membership,mirrored()and pickling still work, underother_readingstoo.2.
Matching.keys()names itselfmatcher.keys(b"x")said "check takes a name string or a ParsedName". The shared_parsedtakes the method's name. The test is parametrized overcheck(each argument) andkeys, and four bad values. From review, not in the brief:bytesgets the decode hintParser.parsegives (decode first, e.g. raw.decode('utf-8')), which the test runs.3. What a suggestion promises across releases
docs/suggest.rstgains one paragraph, the counterpart ofdocs/matching.rst's "a key is a bucket of one nameparser version": whatsuggest()decides can change between releases as its tables and thresholds are tuned, so keep the settings applied (suggestion.patch, orsuggestion.parser.policy) with the data.Suggestion's docstring says it in one sentence (it is the shorter of the two autodoc renders;Parser.suggest's is already long). Decisions entry: group-suggestion, 2026-11-15 ACROSS RELEASES.4. The suggester's proposed statements are decided (added 2026-11-15, docs only)
Every statement in
docs/design/decisions/group-suggestion.mdmarked "Proposed, for review" is accepted as written before 3.1. No code changes.(DECIDED BY 2026-11-15 ACCEPTED)(SCOPE, TABLES, SIGNALS, DECLINED, TURKIC, THRESHOLDS, FIX WAVE, TRAILING INITIAL, LETTER RUNS, CAPITALS, GIVEN NAMES FROM ORCID; TABLES reads "DECIDED THAT DAY; THE REST DECIDED BY…"), and one body sentence, SCOPE's closing "the rest of this file is proposed, for review", which now says it was. That one body edit is declared in the new entry; it was needed for the file to hold no such phrase.Parser.suggestreadAM Hoyas initials and a surname? A given-first byline list (AM Hoy,GH Yoon) is suggestedFAMILY_FIRST#1355's head carried no marker; it gains a parenthetical, since its body called the reach "implementation and record, not decision" and the accepted Standing statement decides the part it words._MIN_PATRONYMIC_VOTESstays five; the Open paragraph is untouched.AGENTS.md, Design philosophy: "as proposed for review in" becomes "as decided in … (accepted 2026-11-15)". No other site called the suggester's statements proposed: the other AGENTS.md files,docs/design/mechanisms.md, the RFC, other decisions files,docs/suggest.rst, the docstrings and the suggester's tools were read for paraphrases too.decisions/README.mdallows four kinds of edit to an old entry "and no others"; replacing a head's status marker is none of them. It is declared in the ACCEPTED entry rather than added to the README as a fifth kind.Also
Not decided, recorded in the TRUTH VALUE entry: a
RoleMatch, aCrossRoleMatchand anOutcomestay truthy (Outcome.CONFLICTincluded).docs/matching.rst: one paragraph and a doctest under "Checking a pair" for the raise, and a labelmatching-grouping-keysat "Grouping by key" for the new paragraph to link to.Release log: no new bullet; a sentence and this PR's link folded into each of the two 3.1.0 bullets (
Parser.matching(),Parser.suggest()).tools/differential/snapshot.jsonlis byte-identical (no parse moves).Checks
uv run pytest(48,676 passed),uv run pytest -n0 -m serial(38 passed),uv run mypy,uv run ruff check,sphinx-build -b doctestand-b html, and the suite on 3.15 in its own environment. Both Sphinx builds print nothing. Re-run after the fix commit.Reviews
pr-review-toolkit:code-revieweron the first commit: attacked the "no truthiness site" claim and found none; found the unguarded hint spelling, the missing bytes hint, the unlinked label and the undecided rows. All fixed or recorded.design-docs-revieweron the first commit's decisions entries: an over-wide universal in ACROSS RELEASES' Why, a Standing line wider than its entry, entries citing no PR, abytearrayarmparse()does not have. All fixed.design-docs-revieweron the acceptance commit: word-diff exact; ShouldParser.suggestreadAM Hoyas initials and a surname? A given-first byline list (AM Hoy,GH Yoon) is suggestedFAMILY_FIRST#1355's body contradicted the accepted reach, and a miscounted sentence. Fixed.design-docs-revieweron the fix commit (dc6e5bc8), with a negative control on the bytes row: no defect in code or tests; three wording points in group-suggestion.md, fixed in400c2e73(docs only, not itself reviewed).🤖 Generated with Claude Code