cf.relaxed_identities

cf.relaxed_identities(*arg)[source]

Use ‘relaxed’ mode when getting a construct identity.

If set to True, sets relaxed=True as the default in calls to a construct’s identity method (e.g. cf.Field.identity).

This is used by construct arithmetic and field construct aggregation.

Parameters

arg: bool or Constant, optional

Returns
Constant

The value prior to the change, or the current value if no new value was specified.

Examples

>>> org = cf.relaxed_identities()
>>> org
False
>>> cf.relaxed_identities(True)
False
>>> cf.relaxed_identities()
True
>>> cf.relaxed_identities(org)
True
>>> cf.relaxed_identities()
False