cf.CfList

class cf.CfList(sequence=())

Bases: _abcoll.MutableSequence

A list-like object (a ‘cf list’) suitable for CF structures.

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.

Methods:

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.
remove As for a built-in list.
reverse As for a built-in list.
sort As for a built-in list.

Methods and attributes defined here:

copy()

CFL.copy() -> a deep copy of CFL

count(value)

CFL.count(value) -> integer – return number of occurrences of value

Uses numerically tolerant equality.

equals(other, rtol=None, atol=None)

Return True if two lists are congruent in that

  1. Each pair of their elements are equal.
  2. Both instances have equal attributes.

Numerical equality is to within a tolerance. Refer to cf for details.

Parameters:
  • other (object) – The variable to compare against for equality.
  • atol (None or float) – Optional. If None then use the default method for setting the absolute tolerance for numerical equality (refer to cf for details). If a number then set the absolute tolerance to this value for all such comparisons.
  • rtol (None or float) – Optional. If None then use the default method for setting the relative tolerance for numerical equality (refer to cf for details). If a number then set the relative tolerance to this value for all such comparisons.
Returns:

True if the two objects are congruent, False otherwise.

index(value, start=0, stop=None)

CFL.index(value, [start, [stop]]) -> integer – return first index of value

Uses numerically tolerant equality.

insert(index, object)

CFL.insert(index, object) – insert object before index

Previous topic

cf.Variable

Next topic

cf.CfDict

This Page