cf.FieldList.getprop

FieldList.getprop(prop, *default)[source]

Get a CF property from each field.

When a default argument is given, it is returned when the attribute doesn’t exist; without it, an exception is raised in that case.

fl.getprop(prop, *default) is equivalent to cf.List(f.getprop(prop, *default) for f in fl).

Parameters:
prop : str

The name of the CF property.

default : optional

Return default if and only if the variable does not have the named property.

Returns:
out : cf.List

The value of the named property, or the default value, for each field.

Previous topic

cf.FieldList.getattr

Next topic

cf.FieldList.hasattr

This Page