Defines all list operations from a small subset of methods.
Subclasses should define _get_element(i), _set_element(i, value),
__len__(), _resize_region(start, end, new_size) and
_constructor(iterable). Define __iter__() for extra speed.
The _get_element() and _set_element() methods are given indices with 0
<= i < len(self).
The _resize_region() method should resize the slice self[start:end] so
that it has size new_size. It is given indices such that start <=
end, 0 <= start <= len(self) and 0 <= end <= len(self). The
resulting elements in self[start:start+new_size] can be set to None or
arbitrary Python values.
The _constructor() method accepts an iterable and should return a new
instance of the same class as self, populated with the elements of the
given iterable.
|
|
|
|
|
|
|
|
|
|
|
_tuple_from_slice(self,
i)
Get (start, end, step) tuple from slice object. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| sort(self,
cmpfunc=None,
key=None,
reverse=False) |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Inherited from object:
__delattr__,
__format__,
__getattribute__,
__init__,
__new__,
__reduce__,
__reduce_ex__,
__setattr__,
__sizeof__,
__subclasshook__
|