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

Extend SymbolTable.lookup() with a "default value" argument to avoid need for try...except. #2585

Closed
arporter opened this issue May 10, 2024 · 1 comment
Labels
enhancement good first issue An issue that is probably suitable for a new PSyclone developer

Comments

@arporter
Copy link
Member

Currently the lookup method of SymbolTable will raise a KeyError if a Symbol cannot be found (c.f. a Python dict). However, this leads to a lot of try..except blocks which could be avoided if we could just tell the method to return e.g. None if no Symbol is found. By adding an optional argument we can make this change backwards-compatible (which is good because it would otherwise touch a lot of code).

@arporter arporter added enhancement good first issue An issue that is probably suitable for a new PSyclone developer labels May 10, 2024
JulienRemy added a commit that referenced this issue Jun 21, 2024
@JulienRemy
Copy link
Collaborator

Oops, just noticed you'd already implemented these w.r.t. #2588 @arporter. Branch 2585_symbol_table_lookup_default_value can thus be disregarded and/or deleted.

arporter added a commit that referenced this issue Jul 22, 2024
sergisiso added a commit that referenced this issue Jul 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement good first issue An issue that is probably suitable for a new PSyclone developer
Projects
None yet
Development

No branches or pull requests

2 participants