cylc-flow
cylc-flow copied to clipboard
Tokens are not properly immutable
Description
#5769 sought to make Tokens instances immutable
https://github.com/cylc/cylc-flow/blob/98dc86aa1ac55952b8902ad58fa267b55d3ec62e/cylc/flow/id.py#L120-L124
However, this does not prevent
tokens.pop(key)
del tokens[key]
tokens.clear()
tokens.popitem()
tokens.setdefault(key, default)
and also there is this method that is used in a couple of places:
https://github.com/cylc/cylc-flow/blob/98dc86aa1ac55952b8902ad58fa267b55d3ec62e/cylc/flow/id.py#L260-L261