-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Python: Dataflow, variable capture #4710
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
Conversation
both via nonlocal and via dict
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, nice to have test of this 👍
I would really like a comment (in the code) explaining why it is important to have BOTH Out
and Through
functions. From your explanation that variable-capture might end up depending on the call-graph, it makes sense to test both scenarios, but when I forget about this in 6 months time, I will certainly be confused about this subtle nuance.
Nitpick: what is up with calling the functions Out
and not out
? 😄
python/ql/test/experimental/dataflow/variable-capture/nonlocal.py
Outdated
Show resolved
Hide resolved
python/ql/test/experimental/dataflow/variable-capture/nonlocal.py
Outdated
Show resolved
Hide resolved
python/ql/test/experimental/dataflow/variable-capture/nonlocal.py
Outdated
Show resolved
Hide resolved
python/ql/test/experimental/dataflow/variable-capture/nonlocal.py
Outdated
Show resolved
Hide resolved
Co-authored-by: Rasmus Wriedt Larsen <rasmuswriedtlarsen@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed in person that although I was not 100% convinced by the added comments explaining why we need both out
and through
, we would just move on 🚋
Tests showing that we do not handle variable capture (ported from C#, adapted slightly).