Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tokens are not properly immutable #6129

Open
MetRonnie opened this issue Jun 10, 2024 · 0 comments
Open

Tokens are not properly immutable #6129

MetRonnie opened this issue Jun 10, 2024 · 0 comments
Labels
bug? Not sure if this is a bug or not
Milestone

Comments

@MetRonnie
Copy link
Member

Description

#5769 sought to make Tokens instances immutable

cylc-flow/cylc/flow/id.py

Lines 120 to 124 in 98dc86a

def __setitem__(self, key, value):
raise Exception('Tokens objects are not mutable')
def update(self, other):
raise Exception('Tokens objects are not mutable')

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:

cylc-flow/cylc/flow/id.py

Lines 260 to 261 in 98dc86a

def pop_token(self) -> Tuple[str, str]:
"""Pop the lowest token.

@MetRonnie MetRonnie added the bug? Not sure if this is a bug or not label Jun 10, 2024
@MetRonnie MetRonnie added this to the 8.4.0 milestone Jun 10, 2024
@oliver-sanders oliver-sanders modified the milestones: 8.4.0, 8.x Jul 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug? Not sure if this is a bug or not
Projects
None yet
Development

No branches or pull requests

2 participants