rope
rope copied to clipboard
Rename refactoring allow the use of Python keywords
Rename refactoring is successfully executed using any Python keyword in B.text.
Steps to reproduce the behavior:
- Code before refactoring:
class B:
def a(self) -> None:
text = 'hello'
-
Apply the Rename refactoring to the variable "text"
-
Expected to Rope emit an error due to the use of a Python keyword.
Adding a validation here makes sense to me. It seems like it should be fairly straightforward to add validation here in rename.py to validate that new_name should be checked against keyword.iskeyword().
Would you want to take a bite at implementing this?