cf.ConstructList¶
- class cf.ConstructList(constructs=None)[source]¶
An ordered sequence of constructs.
The elements of the list are construct of the same type.
The list supports the python list-like operations (such as indexing and methods like
append).>>> fl = cf.ConstructList() >>> len(fl) 0 >>> fl = cf.FieldList(f) >>> len(fl) 1 >>> fl = cf.FieldList([f, g]) >>> len(fl) 2 >>> fl = cf.FieldList(cf.FieldList([f] * 3)) >>> len(fl) 3 >>> len(fl + fl) 6
Such methods provide functionality similar to that of a built-in list. The main difference is that when an element needs to be assessed for equality its
equalsmethod is used, rather than the==operator.Initialisation
- Parameters:
- constructs: (sequence of) constructs
Create a new list with these constructs.
Methods¶
Methods
Append object to the end of the list. |
|
Remove all items from list. |
|
Close all files referenced by each construct in the list. |
|
Return a deep copy. |
|
Return number of occurrences of value. |
|
Whether two lists are the same. |
|
Extend list by appending elements from the iterable. |
|
Return first index of value. |
|
Insert object before index. |
|
Remove and return item at index (default last). |
|
Remove first occurrence of value. |
|
Reverse IN PLACE. |
|
Alias of |
|
Select list elements constructs by identity. |
|
Sort of the list in place. |