list :: Class list
[hide private]
[frames] | no frames]

Class list

object --+
         |
        list

list() -> new list list(sequence) -> new list initialized from sequence's items

Instance Methods [hide private]
  __add__(x, y)
x+y
  __contains__(x, y)
y in x
  __delitem__(x, y)
del x[y]
  __delslice__(x, i, j)
del x[i:j]
  __eq__(x, y)
x==y
  __ge__(x, y)
x>=y
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __getitem__(x, y)
x[y]
  __getslice__(x, i, j)
x[i:j]
  __gt__(x, y)
x>y
  __hash__(x)
hash(x)
  __iadd__(x, y)
x+=y
  __imul__(x, y)
x*=y
  __init__(...)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
  __iter__(x)
iter(x)
  __le__(x, y)
x<=y
  __len__(x)
len(x)
  __lt__(x, y)
x<y
  __mul__(x, n)
x*n
  __ne__(x, y)
x!=y
  __new__(T, S, ...)
  __repr__(x)
repr(x)
  __reversed__(L)
return a reverse iterator over the list
  __rmul__(x, n)
n*x
  __setitem__(x, i, y)
x[i]=y
  __setslice__(x, i, j, y)
x[i:j]=y
  append(L, object)
append object to end
  count(L, value)
return number of occurrences of value
  extend(L, iterable)
extend list by appending elements from the iterable
  index(...)
L.index(value, [start, [stop]]) -> integer -- return first index of value
  insert(L, index, object)
insert object before index
  pop(L, index=...)
remove and return item at index (default last)
  remove(L, value)
remove first occurrence of value
  reverse(L)
reverse *IN PLACE*
  sort(L, cmp=None, key=None, reverse=False)
stable sort *IN PLACE*; cmp(x, y) -> -1, 0, 1

Inherited from object: __delattr__, __reduce__, __reduce_ex__, __setattr__, __str__


Class Variables [hide private]

Inherited from object: __class__


Method Details [hide private]

__add__(x, y)
(Addition operator)

 
x+y

__contains__(x, y)
(In operator)

 
y in x

__delitem__(x, y)
(Index deletion operator)

 
del x[y]

__delslice__(x, i, j)
(Slice deletion operator)

 

del x[i:j]

Use of negative indices is not supported.

__eq__(x, y)
(Equality operator)

 
x==y

__ge__(x, y)
(Greater-than-or-equals operator)

 
x>=y

__getattribute__(...)

 
x.__getattribute__('name') <==> x.name
Overrides: object.__getattribute__

__getitem__(x, y)
(Indexing operator)

 
x[y]

__getslice__(x, i, j)
(Slicling operator)

 

x[i:j]

Use of negative indices is not supported.

__gt__(x, y)
(Greater-than operator)

 
x>y

__hash__(x)
(Hashing function)

 
hash(x)
Overrides: object.__hash__

__iadd__(x, y)

 
x+=y

__imul__(x, y)

 
x*=y

__init__(...)
(Constructor)

 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
Overrides: object.__init__

__iter__(x)

 
iter(x)

__le__(x, y)
(Less-than-or-equals operator)

 
x<=y

__len__(x)
(Length operator)

 
len(x)

__lt__(x, y)
(Less-than operator)

 
x<y

__mul__(x, n)

 
x*n

__ne__(x, y)

 
x!=y

__new__(T, S, ...)

 
Returns:
a new object with type S, a subtype of T

Overrides: object.__new__

__repr__(x)
(Representation operator)

 
repr(x)
Overrides: object.__repr__

__reversed__(L)

 
return a reverse iterator over the list

__rmul__(x, n)

 
n*x

__setitem__(x, i, y)
(Index assignment operator)

 
x[i]=y

__setslice__(x, i, j, y)
(Slice assignment operator)

 

x[i:j]=y

Use of negative indices is not supported.

append(L, object)

 
append object to end

count(L, value)

 
return number of occurrences of value
Returns:
integer

extend(L, iterable)

 
extend list by appending elements from the iterable

index(...)

 
L.index(value, [start, [stop]]) -> integer -- return first index of value

insert(L, index, object)

 
insert object before index

pop(L, index=...)

 
remove and return item at index (default last)
Returns:
item

remove(L, value)

 
remove first occurrence of value

reverse(L)

 
reverse *IN PLACE*

sort(L, cmp=None, key=None, reverse=False)

 
stable sort *IN PLACE*; cmp(x, y) -> -1, 0, 1