Bases: _abcoll.MutableSequence
A list-like object (a ‘cf list’) suitable for CF structures.
When requesting a non-private attribute that the cf list does not have, and the _elements_atts attribute is True, instead of raising an AttributeError a cf list is returned containing the values of the attribute from each of the elements, with a value of None if an element does not have the attribute. The setting of an attribute is as usual, i.e. it is set on the object itself rather that the object’s elements.
Parameters: | sequence (iterable) – Optional. Initialize new list from sequence’s items. |
---|
Overloaded operators
The in (set membership), == and != operators are overloaded to use numerically tolerant equality.
The +, *, += and *= operators behave as for a built-in list. Note in particular that in-place changes to an element of the result of one of these operations will affect the equivalent element on the right hand side, and possibly other equivalent elements in the result itself.
Attribute | (type) Description |
---|---|
_atol | (NoneType or float) Optional. Absolute tolerance for numeric equality. Unset is equivalent to None, which implies a default value. Refer to cf. |
_elements_atts | (bool) If True then do not raise an exception when requesting a non-existent attribute, but broadcast the request to each element of the list. |
_rtol | (NoneType or float) Optional. Relative tolerance for numeric equality. Unset is equivalent to None, which implies a default value. Refer to cf. |
Method | Description |
---|---|
append() | As for a built-in list. |
copy() | Create a deep copy. |
count() | As for a built-in list but using numerically tolerant equality. |
equals() | Determine whether two lists are congruent element-wise. |
extend() | As for a built-in list. |
index() | As for a built-in list but using numerically tolerant equality. |
insert() | As for a built-in list. |
pop() | As for a built-in list. |
properties() | Return a set of writable, public attributes. |
remove() | As for a built-in list. |
reverse() | As for a built-in list. |
sort() | As for a built-in list. |
Create a deep copy of the list. Equivalent to calling copy.deepcopy on the list.
Returns: | A deep copy of the list. |
---|
Returns: | The number of occurrences of value using numerically tolerant equality. |
---|
Return True if two instances are congruent in that each pair of their elements are equal.
Equality of numbers is to within a tolerance. Refer to cf for details.
Parameters: |
|
---|---|
Returns: | True if the two objects are congruent, False otherwise. |
Returns: | The first index of value using numerically tolerant equality. Restrict the search to the slice start:stop. If stop is None then the slice is :obj:`start:`cf. |
---|
L.insert(index, object) – insert object before index
Return a set of writable, public attribute names, excluding methods.
An attribute created by assigning directly to the __dict__ dictionary (as opposed to using setattr()) will not appear in this set.
Parameters: | nc (bool) – If False then exclude attributes whose names begin “nc”. |
---|---|
Returns: | A set of attribute names. |