cf.DimensionCoordinate.hasattr

DimensionCoordinate.hasattr(attr)[source]

Return whether an attribute exists.

f.hasattr(attr) is equivalent to hasattr(f, attr).

See also

delattr, getattr, setattr

Parameters:
attr : str

The attribute’s name.

Returns:
out : bool

Whether the object has the attribute.

Examples:
>>> f.foo = -99
>>> fl.hasattr('foo')
True
>>> del f.foo
>>> fl.hasattr('foo')
False

Previous topic

cf.DimensionCoordinate.getprop

Next topic

cf.DimensionCoordinate.hasprop

This Page