Repository navigation
Conversation
Return NotImplemented for operands without an iteration protocol so sentinel comparisons and reflected equality work for event headers. Keep existing iterable comparisons and iteration exceptions intact. Add regression coverage for unsupported operands, reflected equality, legacy sequences and errors during iterator setup and consumption. Co-Authored-By: Claude Code <noreply@anthropic.com>
Document the user-visible sentinel and reflected-comparison repair tracked in issue python-hyper#214. Co-Authored-By: Claude Code <noreply@anthropic.com>
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.
Related to #214.
Comparing event headers with
None, an integer or an ordinary sentinel currently raisesTypeError. Comparing them withunittest.mock.ANYalso raises before the other operand can handle the comparison.Return
NotImplementedwhen the operand's type supports neither the iterator protocol nor the legacy__getitem__sequence protocol. Otherwise retain the existing content comparison. This preserves iterable comparisons and exceptions from both iterator initialization and consumption.Regression tests cover equality and inequality in both operand orders, reflected comparison with
ANY, existing lists/tuples/iterators/header objects, legacy sequences, and iterator setup/consumption errors. AI-assisted contribution with an independent read-only review; the review's iterator-setup finding was reproduced and corrected.Validation on macOS arm64:
git diff --checkpasses.🤖 Generated with Claude Code