cf.FieldList.count¶
- FieldList.count(value)[source]¶
Return number of occurrences of value.
Each construct in the list is compared with its
equalsmethod, rather than the==operator.Note that
fl.count(value)is equivalent tosum(f.equals(value) for f in fl).See also
Examples
>>> f = cf.FieldList([a, b, c, a]) >>> f.count(a) 2 >>> f.count(b) 1 >>> f.count('a string') 0