edgegraph.structure.collections_.sortedset.SortedSet#

class edgegraph.structure.collections_.sortedset.SortedSet(iterable=None)#

Bases: Set[T], Sequence[T]

Implementation of a set that maintains insertion order. Contents are accessible by index and all set operations are implemented to maintain combined ordering.

__init__(iterable=None)#

Methods

__init__([iterable])

add(element)

Add an element to a set.

clear()

Remove all elements from this set.

copy()

Return a shallow copy of a set.

count(value)

Return number of occurrences of value.

difference(*s)

Return the difference of two or more sets as a new set.

difference_update(*s)

Remove all elements of another set from this set.

discard(element)

Remove an element from a set if it is a member.

get_list()

Return a shallow copy of the underlying list.

get_view(lock)

Return a view on the SortedSet.

index(value[, start, stop])

Return first index of value.

intersection(*s)

Return the intersection of two sets as a new set.

intersection_update(*s)

Update a set with the intersection of itself and another.

isdisjoint

Return True if two sets have a null intersection.

issubset(other, /)

Test whether every element in the set is in other.

issuperset(other, /)

Test whether every element in other is in the set.

pop([index])

Remove and return item at index (default last).

remove(element)

Remove an element from a set; it must be a member.

sort(*[, key, reverse])

Call to the underlying list's sort method.

symmetric_difference(s)

Return the symmetric difference of two sets as a new set.

symmetric_difference_update(s)

Update a set with the symmetric difference of itself and another.

union(*s)

Return the union of sets as a new set.

update(*s)

Update a set with the union of itself and others.

add(element)#

Add an element to a set.

This has no effect if the element is already present.

clear()#

Remove all elements from this set.

copy()#

Return a shallow copy of a set.

count(value)#

Return number of occurrences of value.

difference(*s)#

Return the difference of two or more sets as a new set.

(i.e. all elements that are in this set but not the others.)

difference_update(*s)#

Remove all elements of another set from this set.

discard(element)#

Remove an element from a set if it is a member.

Unlike set.remove(), the discard() method does not raise an exception when an element is missing from the set.

get_list()#

Return a shallow copy of the underlying list.

get_view(lock)#

Return a view on the SortedSet.

index(value, start=0, stop=9223372036854775807)#

Return first index of value.

Raises ValueError if the value is not present.

intersection(*s)#

Return the intersection of two sets as a new set.

(i.e. all elements that are in both sets.)

intersection_update(*s)#

Update a set with the intersection of itself and another.

isdisjoint()#

Return True if two sets have a null intersection.

issubset(other, /)#

Test whether every element in the set is in other.

issuperset(other, /)#

Test whether every element in other is in the set.

pop(index=-1)#

Remove and return item at index (default last).

Raises IndexError if list is empty or index is out of range.

remove(element)#

Remove an element from a set; it must be a member.

If the element is not a member, raise a KeyError.

sort(*, key=None, reverse=False)#

Call to the underlying list’s sort method. Sort the list in ascending order and return None.

The sort is in-place (i.e. the list itself is modified) and stable (i.e. the order of two equal elements is maintained).

If a key function is given, apply it once to each list item and sort them, ascending or descending, according to their function values.

The reverse flag can be set to sort in descending order.

symmetric_difference(s)#

Return the symmetric difference of two sets as a new set.

(i.e. all elements that are in exactly one of the sets.)

symmetric_difference_update(s)#

Update a set with the symmetric difference of itself and another.

union(*s)#

Return the union of sets as a new set.

(i.e. all elements that are in either set.)

update(*s)#

Update a set with the union of itself and others.