As expected, OrderedSet behaves much like a normal set (and a list as well)
>>> OrderedSet([1,4,2]) == [1,4,2]
True
however, it would be nice to be able to perform slices on them as well:
>>> [1,4,2][2:]
[2]
>>>
>>> OrderedSet([1,4,2])[2:]
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "_orderedset.pyx", line 343, in orderedset._orderedset._OrderedSet.__getitem__ (lib/orderedset/_orderedset.c:6276)
TypeError: an integer is required
As expected,
OrderedSet
behaves much like a normal set (and a list as well)however, it would be nice to be able to perform slices on them as well: