You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
davidcastellsmannequin opened this issue
Feb 11, 2022
· 4 comments
Labels
3.7 (EOL)end of life3.8only security fixes3.9only security fixes3.10only security fixesstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error
If I create a class derived from ast.NodeTransformer and implement the visit_Call.
When run on the below code, the visit_Call function is only called once (for the print function, and not for ord). It looks like calls in function arguments are ignored.
defmain():
print(ord('A'))
On the other hand, on the following code it correctly visits both functions (print and ord).
It looks like calls in function arguments are ignored.
Please share a small, self-contained reproducer.
From what I can assume by this message, the problem is that you are not calling self.generic_visit(node) on the first call you are handling. If you don't call visit/generic_visit on the rood node that you are handling (print(ord('A')), then it will never visit ord('A') in a standalone fashion.
3.7 (EOL)end of life3.8only security fixes3.9only security fixes3.10only security fixesstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: