Skip to content

Fix AND→OR guards in SortableImport{Item}.__add__#362

Open
thatch wants to merge 1 commit into
facebook:mainfrom
thatch:and-or-inversion
Open

Fix AND→OR guards in SortableImport{Item}.__add__#362
thatch wants to merge 1 commit into
facebook:mainfrom
thatch:and-or-inversion

Conversation

@thatch
Copy link
Copy Markdown
Contributor

@thatch thatch commented May 1, 2026

Both guards used and, so they only raised when both fields mismatched simultaneously. bar as x + bar as y (same name, different asname) and from os … + from sys … (same sort_key, different stem) silently succeeded. Change to or so either mismatch raises. Add three regression tests that target each of the two previously-dead raise sites.

Both guards used `and`, so they only raised when *both* fields
mismatched simultaneously.  `bar as x` + `bar as y` (same name,
different asname) and `from os …` + `from sys …` (same sort_key,
different stem) silently succeeded.  Change to `or` so either
mismatch raises.  Add three regression tests that target each of the
two previously-dead raise sites.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant