Describe the bug
The type alias statement is a new kind of assignment statement since Python 3.12+. Currently they are not recognised as assignment statement that can define a variable.
To Reproduce
Steps to reproduce the behavior:
- Code before refactoring:
type old_name_1 = int
x: old_name_1 = 1
type Alias[old_name_2] = list[old_name_2]
print(old_name_2) # this should be untouched
-
Describe the refactoring you want to do: rename old_name_xxx to new_name_xxx
-
Expected code after refactoring:
type new_name_1 = int
x: new_name_1 = 1
type Alias[new_name_2] = list[new_name_2]
print(old_name_2) # this should be untouched
- Describe the error or unexpected result that you are getting
RefactoringError: Rename refactoring should be performed on resolvable python identifiers
Describe the bug
The type alias statement is a new kind of assignment statement since Python 3.12+. Currently they are not recognised as assignment statement that can define a variable.
To Reproduce
Steps to reproduce the behavior:
Describe the refactoring you want to do: rename
old_name_xxxtonew_name_xxxExpected code after refactoring: