Conversation
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.
complement({1, 2}) ^ {2, 3}currently returnscomplement({1}), so it still contains3even though3belongs to both operands.symmetric_difference_update()gives a different wrong result: it leaves2excluded although2belongs only to the right operand.Apply symmetric difference to the stored finite sets when exactly one operand is complemented. This follows
(~A) ^ B == ~(A ^ B)and fixes both the operator and the mutating method.Add 40 regression cases covering overlapping, identical, disjoint, and empty inputs; ordinary sets, frozensets, and both complement representations; reversed operands; and applying the update twice to restore the original membership. Expected results come from ordinary set operations on sampled membership, including values outside both finite inputs.
Validation on Linux:
python -m pytest --doctest-modules boltons tests -q— 712 passed.uvx --with tox-uv tox -e py314 -- -q— 712 passed, including package build and doctests.git diff --checkpasses.Made with Astra on Codex