class documentation

class ListMixin:

Known subclasses: django.contrib.gis.geos.geometry.GEOSGeometry

View In Hierarchy

A base class which provides complete list interface. Derived classes must call ListMixin's __init__() function and implement the following:

function _get_single_external(self, i):
Return single item with index i for general use. The index i will always satisfy 0 <= i < len(self).
function _get_single_internal(self, i):
Same as above, but for use within the class [Optional] Note that if _get_single_internal and _get_single_internal return different types of objects, _set_list must distinguish between the two and handle each appropriately.
function _set_list(self, length, items):

Recreate the entire object.

NOTE: items may be a generator which calls _get_single_internal. Therefore, it is necessary to cache the values in a temporary:

temp = list(items)

before clobbering the original storage.

function _set_single(self, i, value):
Set the single item at index i to value [Optional] If left undefined, all mutations will result in rebuilding the object using _set_list.
function __len__(self):
Return the length
int _minlength:
The minimum legal length [Optional]
int _maxlength:
The maximum legal length [Optional]
type or tuple _allowed:
A type or tuple of allowed item types [Optional]
Method __add__ add another list-like object
Method __delitem__ Delete the item(s) at the specified index/slice.
Method __eq__ Undocumented
Method __getitem__ Get the item(s) at the specified index/slice.
Method __iadd__ add another list-like object to self
Method __imul__ multiply
Method __init__ Undocumented
Method __lt__ Undocumented
Method __mul__ multiply
Method __radd__ add to another list-like object
Method __rmul__ multiply
Method __setitem__ Set the item(s) at the specified index/slice.
Method ​_assign​_extended​_slice Assign an extended slice by re-assigning individual items
Method ​_assign​_extended​_slice​_rebuild Assign an extended slice by rebuilding entire list
Method ​_assign​_simple​_slice Assign a simple slice; Can assign slice of any length
Method ​_check​_allowed Undocumented
Method ​_checkindex Undocumented
Method ​_rebuild Undocumented
Method ​_set​_single​_rebuild Undocumented
Method ​_set​_slice Assign values to a slice of the object
Method append Standard list append method
Method count Standard list count method
Method extend Standard list extend method
Method index Standard list index method
Method insert Standard list insert method
Method pop Standard list pop method
Method remove Standard list remove method
Method reverse Standard list reverse method
Method sort Standard list sort method
Class Variable ​_maxlength Undocumented
Class Variable ​_minlength Undocumented
Instance Variable ​_get​_single​_internal Undocumented
Instance Variable ​_set​_single Undocumented
def __add__(self, other):
add another list-like object
def __delitem__(self, index):
Delete the item(s) at the specified index/slice.
def __eq__(self, other):

Undocumented

def __getitem__(self, index):
Get the item(s) at the specified index/slice.
def __iadd__(self, other):
add another list-like object to self
def __imul__(self, n):
multiply
def __init__(self, *args, **kwargs):
def __lt__(self, other):

Undocumented

def __mul__(self, n):
multiply
def __radd__(self, other):
add to another list-like object
def __rmul__(self, n):
multiply
def __setitem__(self, index, val):
Set the item(s) at the specified index/slice.
def _assign_extended_slice(self, start, stop, step, valueList):
Assign an extended slice by re-assigning individual items
def _assign_extended_slice_rebuild(self, start, stop, step, valueList):
Assign an extended slice by rebuilding entire list
def _assign_simple_slice(self, start, stop, valueList):
Assign a simple slice; Can assign slice of any length
def _check_allowed(self, items):

Undocumented

def _checkindex(self, index):

Undocumented

def _rebuild(self, newLen, newItems):

Undocumented

def _set_single_rebuild(self, index, value):

Undocumented

def _set_slice(self, index, values):
Assign values to a slice of the object
def append(self, val):
Standard list append method
def count(self, val):
Standard list count method
def extend(self, vals):
Standard list extend method
def index(self, val):
Standard list index method
def insert(self, index, val):
Standard list insert method
def pop(self, index=-1):
Standard list pop method
def remove(self, val):
Standard list remove method
def reverse(self):
Standard list reverse method
def sort(self, key=None, reverse=False):
Standard list sort method
_maxlength =

Undocumented