cf.Coordinate.hasattr

Coordinate.hasattr(attr)[source]

Return whether an attribute exists.

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

Parameters :
attr : str

The attribute’s name.

Returns :
out : bool

Whether the object has the attribute.

See also

delattr, getattr, setattr

Examples

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

Previous topic

cf.Coordinate.getprop

Next topic

cf.Coordinate.hasprop

This Page