| Trees | Indices | Help |
|
|---|
|
|
Extends the built-in type 'list' to support dictionary-like access using []. The internal representation is as an ordinary list of (key,value) pairs, not a hash table like an ordinary dictionary, so that the elements will remain ordered.
Note: Not all list operations will work as expected, because [] does not return the name tuple.
Redefined functions:
__getitem__ ([,])
__setitem__ ([,])
append -- Now takes a tuple (key,value) so that value
can be later accessed by [key].
New functions modeled from dictionaries:
get set has_key keys items update
Key values are not allowed to be None, because None is a default return value for get() when there is no object by that name.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
Inherited from Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
|
|
Append a new object to the end of the existing list. Accepts a 2-tuple (key, value). Strictly speaking, this operation did not need to be redefined in this subclass, but by forcing the tuple in the function parameters, we may be able to catch an erroneous assignment.
|
Get the value with the specified key. Returns None if no value with that key exists. |
|
|
| Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Thu Aug 5 14:59:38 2010 | http://epydoc.sourceforge.net |