MCPcopy Create free account
hub / github.com/grantjenks/python-sortedcontainers / SortedList

Class SortedList

sortedcontainers/sortedlist.py:85–1683  ·  view source on GitHub ↗

Sorted list is a sorted mutable sequence. Sorted list values are maintained in sorted order. Sorted list values must be comparable. The total ordering of values must not change while they are stored in the sorted list. Methods for adding values: * :func:`SortedList.add` *

Source from the content-addressed store, hash-verified

83
84
85class SortedList(MutableSequence):
86 """Sorted list is a sorted mutable sequence.
87
88 Sorted list values are maintained in sorted order.
89
90 Sorted list values must be comparable. The total ordering of values must
91 not change while they are stored in the sorted list.
92
93 Methods for adding values:
94
95 * :func:`SortedList.add`
96 * :func:`SortedList.update`
97 * :func:`SortedList.__add__`
98 * :func:`SortedList.__iadd__`
99 * :func:`SortedList.__mul__`
100 * :func:`SortedList.__imul__`
101
102 Methods for removing values:
103
104 * :func:`SortedList.clear`
105 * :func:`SortedList.discard`
106 * :func:`SortedList.remove`
107 * :func:`SortedList.pop`
108 * :func:`SortedList.__delitem__`
109
110 Methods for looking up values:
111
112 * :func:`SortedList.bisect_left`
113 * :func:`SortedList.bisect_right`
114 * :func:`SortedList.count`
115 * :func:`SortedList.index`
116 * :func:`SortedList.__contains__`
117 * :func:`SortedList.__getitem__`
118
119 Methods for iterating values:
120
121 * :func:`SortedList.irange`
122 * :func:`SortedList.islice`
123 * :func:`SortedList.__iter__`
124 * :func:`SortedList.__reversed__`
125
126 Methods for miscellany:
127
128 * :func:`SortedList.copy`
129 * :func:`SortedList.__len__`
130 * :func:`SortedList.__repr__`
131 * :func:`SortedList._check`
132 * :func:`SortedList._reset`
133
134 Sorted lists use lexicographical ordering semantics when compared to other
135 sequences.
136
137 Some methods of mutable sequences are not supported and will raise
138 not-implemented error.
139
140 """
141 DEFAULT_LOAD_FACTOR = 1000
142

Callers 15

test_initFunction · 0.90
test_addFunction · 0.90
test_updateFunction · 0.90
test_containsFunction · 0.90
test_discardFunction · 0.90
test_removeFunction · 0.90
test_remove_valueerror1Function · 0.90
test_remove_valueerror2Function · 0.90
test_remove_valueerror3Function · 0.90
test_deleteFunction · 0.90
test_getitemFunction · 0.90
test_getitem_sliceFunction · 0.90

Calls

no outgoing calls

Tested by 15

test_initFunction · 0.72
test_addFunction · 0.72
test_updateFunction · 0.72
test_containsFunction · 0.72
test_discardFunction · 0.72
test_removeFunction · 0.72
test_remove_valueerror1Function · 0.72
test_remove_valueerror2Function · 0.72
test_remove_valueerror3Function · 0.72
test_deleteFunction · 0.72
test_getitemFunction · 0.72
test_getitem_sliceFunction · 0.72