MCPcopy Index your code
hub / github.com/grantjenks/python-sortedcontainers / SortedSet

Class SortedSet

sortedcontainers/sortedset.py:36–733  ·  view source on GitHub ↗

Sorted set is a sorted mutable set. Sorted set values are maintained in sorted order. The design of sorted set is simple: sorted set uses a set for set-operations and maintains a sorted list of values. Sorted set values must be hashable and comparable. The hash and total orderi

Source from the content-addressed store, hash-verified

34
35
36class SortedSet(MutableSet, Sequence):
37 """Sorted set is a sorted mutable set.
38
39 Sorted set values are maintained in sorted order. The design of sorted set
40 is simple: sorted set uses a set for set-operations and maintains a sorted
41 list of values.
42
43 Sorted set values must be hashable and comparable. The hash and total
44 ordering of values must not change while they are stored in the sorted set.
45
46 Mutable set methods:
47
48 * :func:`SortedSet.__contains__`
49 * :func:`SortedSet.__iter__`
50 * :func:`SortedSet.__len__`
51 * :func:`SortedSet.add`
52 * :func:`SortedSet.discard`
53
54 Sequence methods:
55
56 * :func:`SortedSet.__getitem__`
57 * :func:`SortedSet.__delitem__`
58 * :func:`SortedSet.__reversed__`
59
60 Methods for removing values:
61
62 * :func:`SortedSet.clear`
63 * :func:`SortedSet.pop`
64 * :func:`SortedSet.remove`
65
66 Set-operation methods:
67
68 * :func:`SortedSet.difference`
69 * :func:`SortedSet.difference_update`
70 * :func:`SortedSet.intersection`
71 * :func:`SortedSet.intersection_update`
72 * :func:`SortedSet.symmetric_difference`
73 * :func:`SortedSet.symmetric_difference_update`
74 * :func:`SortedSet.union`
75 * :func:`SortedSet.update`
76
77 Methods for miscellany:
78
79 * :func:`SortedSet.copy`
80 * :func:`SortedSet.count`
81 * :func:`SortedSet.__repr__`
82 * :func:`SortedSet._check`
83
84 Sorted list methods available:
85
86 * :func:`SortedList.bisect_left`
87 * :func:`SortedList.bisect_right`
88 * :func:`SortedList.index`
89 * :func:`SortedList.irange`
90 * :func:`SortedList.islice`
91 * :func:`SortedList._reset`
92
93 Additional sorted list methods available, if key-function used:

Callers 15

test_initFunction · 0.90
stress_operatorFunction · 0.90
stress_issubsetFunction · 0.90
stress_issupersetFunction · 0.90
test_stressFunction · 0.90
test_initFunction · 0.90
test_init_keyFunction · 0.90
test_containsFunction · 0.90
test_getitemFunction · 0.90
test_getitem_sliceFunction · 0.90
test_getitem_keyFunction · 0.90
test_delitemFunction · 0.90

Calls

no outgoing calls

Tested by 15

test_initFunction · 0.72
stress_operatorFunction · 0.72
stress_issubsetFunction · 0.72
stress_issupersetFunction · 0.72
test_stressFunction · 0.72
test_initFunction · 0.72
test_init_keyFunction · 0.72
test_containsFunction · 0.72
test_getitemFunction · 0.72
test_getitem_sliceFunction · 0.72
test_getitem_keyFunction · 0.72
test_delitemFunction · 0.72