Skip to content
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

assertUnique might break for collections that are not integer-indexable #74

Open
thejunglejane opened this issue Jun 7, 2018 · 1 comment
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@thejunglejane
Copy link
Contributor

Description

Since we use slice indexing, I think assertUnique will fail on collections which are not integer-indexable. Sets have this property, but sets already enforce uniqueness so that's not a real problem. multisets may expose a problem here though?

@thejunglejane thejunglejane added good first issue Good for newcomers bug Something isn't working labels Jun 7, 2018
@lvllvl
Copy link

lvllvl commented Mar 6, 2023

hi,

To account for any container of type set

  • Can we simply check: if isinstance( container, set ) then break from assertUnique if True?

Regarding multisets 3.0.1

  • are we only concerned about this specific iteration of a multiset data structure? I read that collections.Counter could technically be counted as a multiset, so I guess I'd need to account for that as well (if you'd like to include it)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants