-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closes #49 duplicate-banning factories #54
Conversation
Codecov Report
@@ Coverage Diff @@
## master #54 +/- ##
==========================================
- Coverage 90.59% 90.51% -0.09%
==========================================
Files 6 6
Lines 617 622 +5
==========================================
+ Hits 559 563 +4
- Misses 58 59 +1
Continue to review full report at Codecov.
|
@@ -92,6 +98,10 @@ def immutableset( | |||
if value not in containment_set: | |||
containment_set.add(value) | |||
iteration_order.append(value) | |||
elif forbid_duplicate_elements: | |||
raise ValueError( | |||
"Input collection has duplicate items and forbid_duplicate_elements=False" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This got merged before I could take a look, but could this be modified to give the repr
of the duplicate element? This would make debugging much easier.
Added
immutableset_from_unique_elements
factory andforbid_duplicate_elements
kwarg