cylc-flow icon indicating copy to clipboard operation
cylc-flow copied to clipboard

Tokens are not properly immutable

Open MetRonnie opened this issue 1 year ago • 0 comments

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

MetRonnie avatar Jun 10 '24 11:06 MetRonnie