|
|
| __init__ (self, initlist=None, source=None, items=None, parent=None, parent_offset=None) |
| |
|
| __str__ (self) |
| |
|
| __repr__ (self) |
| |
|
| __lt__ (self, other) |
| |
|
| __le__ (self, other) |
| |
|
| __eq__ (self, other) |
| |
|
| __ne__ (self, other) |
| |
|
| __gt__ (self, other) |
| |
|
| __ge__ (self, other) |
| |
|
| __contains__ (self, item) |
| |
|
| __len__ (self) |
| |
|
| __getitem__ (self, i) |
| |
|
| __setitem__ (self, i, item) |
| |
|
| __delitem__ (self, i) |
| |
|
| __add__ (self, other) |
| |
|
| __radd__ (self, other) |
| |
|
| __iadd__ (self, other) |
| |
|
| __mul__ (self, n) |
| |
|
| __imul__ (self, n) |
| |
|
| extend (self, other) |
| |
|
| append (self, item, source=None, offset=0) |
| |
|
| insert (self, i, item, source=None, offset=0) |
| |
|
| pop (self, i=-1) |
| |
| | trim_start (self, n=1) |
| |
| | trim_end (self, n=1) |
| |
|
| remove (self, item) |
| |
|
| count (self, item) |
| |
|
| index (self, item) |
| |
|
| reverse (self) |
| |
|
| sort (self, *args) |
| |
| | info (self, i) |
| |
| | source (self, i) |
| |
| | offset (self, i) |
| |
| | disconnect (self) |
| |
| | xitems (self) |
| |
| | pprint (self) |
| |
List with extended functionality: slices of ViewList objects are child
lists, linked to their parents. Changes made to a child list also affect
the parent list. A child list is effectively a "view" (in the SQL sense)
of the parent list. Changes to parent lists, however, do *not* affect
active child lists. If a parent list is changed, any active child lists
should be recreated.
The start and end of the slice can be trimmed using the `trim_start()` and
`trim_end()` methods, without affecting the parent list. The link between
child and parent lists can be broken by calling `disconnect()` on the
child list.
Also, ViewList objects keep track of the source & offset of each item.
This information is accessible via the `source()`, `offset()`, and
`info()` methods.