pydu/docs/set.rst

15 lines
272 B
ReStructuredText
Raw Normal View History

2017-10-31 15:54:39 +00:00
Set
----
2017-11-12 18:25:30 +00:00
.. py:class:: pydu.set.OrderedSet(iterable=None)
2017-10-31 15:54:39 +00:00
A set which keeps the ordering of the inserted items.
>>> from pydu.set import OrderedSet
>>> s = OrderedSet([1, 3, 1, 2])
>>> list(s)
[1, 3, 2]
>>> s.discard(3)
>>> list(s)
[1, 2]