Skip to content
New issue

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

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

Already on GitHub? # to your account

Incorrect DFG edges for tuples used when iterating over a list/set/dict comprehension #2017

Closed
KuechA opened this issue Jan 31, 2025 · 2 comments · Fixed by #2016
Closed
Assignees

Comments

@KuechA
Copy link
Contributor

KuechA commented Jan 31, 2025

The DFG edges for tuples used as variables used when iterating over a list/set/dict comprehension are incorrect. Currently, the variables/references which hold the values flow into the tuple but it should be the opposite direction. Example:

[foo(k, v) for (k, v) in x]

I'd expect a flow from x to the tuple (InitializerListExpression) and then, an indexed flow to k and v respectively and from there to the References k and v used as arguments of foo.

This issue is a bit related to #1957 but even when fixing #1957, this issue would remain.

@oxisto
Copy link
Member

oxisto commented Jan 31, 2025

Can we fix both of that in the same PRs? Seems related

@KuechA
Copy link
Contributor Author

KuechA commented Jan 31, 2025

That's my goal. However, I think we should figure out if there are more places and/or a generalized way where we have to turn around the DFG edges between a node n and its children based on n.astParent and also in which cases checking a single layer of the astParent won't be sufficient.

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
2 participants