Viewing file: list-class.html (37.33 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
list
Class list
object --+
|
list
list() -> new empty list
list(iterable) -> new list initialized from iterable's items
|
|
|
__contains__(x,
y)
y in x |
|
|
|
__delitem__(x,
y)
del x[y] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
new empty list
|
__init__()
x.__init__(...) initializes x; see x.__class__.__doc__ for signature |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
a new object with type S, a subtype of T
|
|
|
|
|
__reversed__(L)
return a reverse iterator over the list |
|
|
|
|
|
__setitem__(x,
i,
y)
x[i]=y |
|
|
|
|
size of object in memory, in bytes
|
|
|
append(L,
object)
append object to end |
|
|
integer
|
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 |
|
|
item
|
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*;... |
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__reduce__ ,
__reduce_ex__ ,
__setattr__ ,
__str__ ,
__subclasshook__
|
Inherited from object :
__class__
|
__delslice__(x,
i,
j)
(Slice deletion operator)
|
|
del x[i:j]
Use of negative indices is not supported.
|
x.__getattribute__('name') <==> x.name
- Overrides:
object.__getattribute__
|
__getslice__(x,
i,
j)
(Slicling operator)
|
|
x[i:j]
Use of negative indices is not supported.
|
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
- Returns:
new empty list
- Overrides:
object.__init__
|
- Returns:
a new object with type S, a subtype of T
- Overrides:
object.__new__
|
__repr__(x)
(Representation operator)
|
|
repr(x)
- Overrides:
object.__repr__
|
__setslice__(x,
i,
j,
y)
(Slice assignment operator)
|
|
x[i:j]=y
Use of negative indices is not supported.
|
size of L in memory, in bytes
- Returns:
size of object in memory, in bytes
- Overrides:
object.__sizeof__
|
L.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.
|
remove and return item at index (default last).
Raises IndexError if list is empty or index is out of range.
- Returns:
item
|
remove first occurrence of value.
Raises ValueError if the value is not present.
|
sort(L,
cmp=None,
key=None,
reverse=False)
|
|
stable sort *IN PLACE*;
cmp(x, y) -> -1, 0, 1
|
|