cf.Field.index

Field.index(x, start=0, stop=None)

L.index(value, [start, [stop]]) – return first index of value.

Each field in the field is compared with the field’s equals method (as aopposed to the == operator).

It is an error if there is no such field.

Note that f.index(x) is equivalent to 0 if f.equals(x) else 0.

if self.equals(x):
return 1

return 0

#— End: def

See also

list.index

Examples:
>>>