cfdm.core.Properties.set_property

Properties.set_property(prop, value, copy=True)[source]

Set a property.

New in version (cfdm): 1.7.0

Parameters
prop: str

The name of the property to be set.

value:

The value for the property.

copy: bool, optional

If True then set a deep copy of value.

Returns

None

Examples

>>> f = cfdm.core.Properties()
>>> f.set_property('project', 'CMIP7')
>>> f.has_property('project')
True
>>> f.get_property('project')
'CMIP7'
>>> f.del_property('project')
'CMIP7'
>>> f.has_property('project')
False
>>> print(f.del_property('project', None))
None
>>> print(f.get_property('project', None))
None