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

Missing write hook call? #79

Open
AryazE opened this issue Nov 18, 2024 · 0 comments
Open

Missing write hook call? #79

AryazE opened this issue Nov 18, 2024 · 0 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@AryazE
Copy link
Collaborator

AryazE commented Nov 18, 2024

In

with foo() as f:
   ...

and

for i in l:
   ...

The write hook is not called to indicate the assignment of the new values to f and i in the above examples.
This means that the analyses interested in value assignments need to track them via multiple analysis hooks.
Since there are no "assignment" hooks now, and the write hook does not semantically apply here, one option is to add a new analysis hook for all assignments.
Such a hook could also be applied in cases where the default value for an argument of a function call is used. An implementation of that could be done by instrumenting a decorator that inspects the provided and the required arguments and calls the assignment hook for the missing arguments.

@AryazE AryazE added enhancement New feature or request question Further information is requested labels Nov 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

1 participant