Skip to content

Handle duplicate sequences in superset checks - #110

Open
muneikh wants to merge 1 commit into
rspeer:masterfrom
muneikh:fix-superset-sequence-duplicates
Open

muneikh wants to merge 1 commit into
rspeer:masterfrom
muneikh:fix-superset-sequence-duplicates

Conversation

@muneikh

@muneikh muneikh commented Oct 11, 2026

Copy link
Copy Markdown

OrderedSet([1]).issuperset([1, 1]) incorrectly returns False, because the length shortcut treats duplicate sequence entries as distinct set elements. Apply that shortcut only to set inputs and keep the existing membership check for sequences.

Twelve regression cases compare list and tuple inputs with the built-in set behavior, covering duplicates, absent values and empty inputs; six fail before the fix. The full test and doctest suite passes on Python 3.10 and 3.13 (65 cases each).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant