| Home | Trees | Indices | Help |
|
|---|
|
|
object --+
|
list --+
|
ValidatedList --+
|
object --+ |
| |
utils.graph.DetailNode --+ |
| |
any_type.AnyType --+
|
AnyArray --+
|
UniformArray
Wrapper for array with elements of the same type; this type must be a subclass of L{pyffi.object_models.any_type.AnyType}.
>>> from pyffi.object_models.simple_type import SimpleType >>> class MyInt(SimpleType): ... # in practice one would implement some sort of type checking ... # for this example we keep it simple ... def __init__(self, value=0): ... self._value = value >>> class ListOfInts(UniformArray): ... ItemType = MyInt >>> testlist = ListOfInts() >>> testlist.append(MyInt(value=20)) >>> testlist.extend([MyInt(value=val) for val in range(2, 10, 2)]) >>> print(testlist) MyInt array: [00] 20 [01] 2 [02] 4 [03] 6 [04] 8 <BLANKLINE> >>> [item.value for item in testlist[::-2]] [8, 4, 20]
@cvar ItemType: Type of the elements of this array. :type ItemType: L{pyffi.object_models.any_type.AnyType}
|
|||
|
__metaclass__ Metaclass for L{UniformArray}. |
|||
|
ItemType Abstract base class from which all types are derived. |
|||
|
|||
|
Inherited from Inherited from Inherited from Inherited from Inherited from Inherited from |
|||
|
|||
|
|||
|
|||
|
Inherited from |
|||
|
|||
|
Inherited from |
|||
|
|||
|
| Home | Trees | Indices | Help |
|
|---|
| Generated by Epydoc 3.0.1 on Mon Oct 10 19:03:56 2011 | http://epydoc.sourceforge.net |