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.
Also, ViewList objects keep track of the source & offset of each item.
This information is accessible via the source(), offset(), and
info() methods.
| Method Summary |
| |
__init__(self,
initlist,
source,
items,
parent,
parent_offset)
|
| |
__add__(self,
other)
|
| |
__cmp__(self,
other)
|
| |
__contains__(self,
item)
|
| |
__delitem__(self,
i)
|
| |
__eq__(self,
other)
|
| |
__ge__(self,
other)
|
| |
__getitem__(self,
i)
|
| |
__gt__(self,
other)
|
| |
__iadd__(self,
other)
|
| |
__imul__(self,
n)
|
| |
__le__(self,
other)
|
| |
__len__(self)
|
| |
__lt__(self,
other)
|
| |
__mul__(self,
n)
|
| |
__ne__(self,
other)
|
| |
__radd__(self,
other)
|
| |
__repr__(self)
|
| |
__rmul__(self,
n)
|
| |
__setitem__(self,
i,
item)
|
| |
__str__(self)
|
| |
append(self,
item,
source,
offset)
|
| |
count(self,
item)
|
| |
disconnect(self)
Break link between this list and parent list. |
| |
extend(self,
other)
|
| |
index(self,
item)
|
| |
info(self,
i)
Return source & offset for index i. |
| |
insert(self,
i,
item,
source,
offset)
|
| |
offset(self,
i)
Return offset for index i. |
| |
pop(self,
i)
|
| |
remove(self,
item)
|
| |
reverse(self)
|
| |
sort(self,
*args)
|
| |
source(self,
i)
Return source for index i. |
| |
trim_end(self,
n)
Remove items from the end of the list, without touching the parent. |
| |
trim_start(self,
n)
Remove items from the start of the list, without touching the parent. |