rope.base.utils.datastructures ============================== .. py:module:: rope.base.utils.datastructures Classes ------- .. autoapisummary:: rope.base.utils.datastructures.OrderedSet Module Contents --------------- .. py:class:: OrderedSet(iterable=None) Bases: :py:obj:`collections.abc.MutableSet` A mutable set is a finite, iterable container. This class provides concrete generic implementations of all methods except for __contains__, __iter__, __len__, add(), and discard(). To override the comparisons (presumably for speed, as the semantics are fixed), all you have to do is redefine __le__ and then the other operations will automatically follow suit. .. py:attribute:: map .. py:method:: add(key) Add an element. .. py:method:: intersection(set_b) .. py:method:: discard(key) Remove an element. Do not raise an exception if absent. .. py:method:: pop(last=True) Return the popped value. Raise KeyError if empty. .. py:method:: remove(value) Remove an element. If not a member, raise a KeyError. .. py:method:: clear() This is slow (creates N new iterators!) but effective. .. py:method:: isdisjoint(other) Return True if two sets have a null intersection.