simonpercivall / orderedset

Ordered Set implementation in Cython
Other
74 stars 14 forks source link

Should instanceof(..., set) work? #13

Open joaoe opened 6 years ago

joaoe commented 6 years ago

Should this yield True ?

>>> isinstance(OrderedSet(), set)

Given OrderedSet shares the same API and already inherits from collections.Set, this check makes sense to me at least, so OrderedSet would be compatible with other code that already checks for set.

simonpercivall commented 6 years ago

I'm unsure. Both set and OrderedSet are (virtual) subclasses of MutableSet, and as such OrderedSet isn't really a subclass of set. But I see your point on convenience.

simonpercivall commented 6 years ago

I'll think on registering OrderedSet as a typing.Set, however.