cfdm.core.Container._has_component

Container._has_component(component)[source]

Whether a component has been set.

New in version (cfdm): 1.7.0

Parameters
component:

The name of the component.

Returns
bool

True if the component has been set, otherwise False.

Examples:

>>> f = cfdm.core.Container()
>>> f._set_component('foo', 'bar')
>>> f._has_component('foo')
True
>>> f._get_component('foo')
'bar'
>>> f._del_component('foo')
'bar'
>>> f._has_component('foo')
False