twosigma/marbles

assertUnique might break for collections that are not integer-indexable

thejunglejane opened this issue · 1 comments

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?

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)