See PR #579.
Background
- rope.base.ast contains five functions: parse, walk, get_child_nodes, call_for_nodes, and get_children.
- Calls to the parse and walk functions appear in many places throughout Rope's code.
- Calls to the get_child_nodes, call_for_nodes, and get_children appear less frequently.
None of these three functions appear in Python's ast module.
- Only rope.base.ast.parse calls Python's ast.parse function.
- No calls to Python's ast.walk function appear in Rope's code.
Proposal
It should be straightforward and safe to do the following:
Rationale
ast will always mean Python's ast module.
- It will always be clear that
parse and walk refer to the functions in astutils.
Update: The new code revealed that _search_in_f_string In rope/refactor/occurrences.py calls the "real" ast.parse and ast.walk functions.
See PR #579.
Background
None of these three functions appear in Python's ast module.
Proposal
It should be straightforward and safe to do the following:
As a happy side effect, this will eliminate
from ast import *from Rope's codebase.rope.base.astutilsinstead ofrope.base.asteverywhere.astmodule as needed, including in astutils.py.astutilsqualifier, except within astutils itself.Rationale
astwill always mean Python'sastmodule.parseandwalkrefer to the functions inastutils.Update: The new code revealed that _search_in_f_string In rope/refactor/occurrences.py calls the "real" ast.parse and ast.walk functions.