renaming a generic doesn't rename the string #2720
Replies: 4 comments
-
The string you provide in the |
Beta Was this translation helpful? Give feedback.
-
While that is true, I can't imagine a scenario where someone renames a Current behavior is very annoying. |
Beta Was this translation helpful? Give feedback.
-
according to the PEP:
this sounds more like a requirement than a convention. mypy also doesn't recognize when the string has a different value: from typing import TypeVar
T = TypeVar("U")
def foo() -> T: ...
https://mypy-play.net/?mypy=latest&python=3.10&gist=988c164a48965c40159ae3c791141f86 so since the result of the rename is completely invalid, i think it's an issue that it doesn't change the string |
Beta Was this translation helpful? Give feedback.
-
Moving this issue to discussion as an enhancement request for comments and upvotes. |
Beta Was this translation helpful? Give feedback.
-
VS Code version
1.63
Extension version
2021.11.1422169775
OS type
Windows
OS version
10
Python distribution
python.org
Python version
3.10
Language server
Default
Expected behaviour
the argument passed to the generic is renamed
Actual behaviour
only the variable is renamed
Steps to reproduce
T
variable, hit f2 and rename itLogs
No response
Code of Conduct
Beta Was this translation helpful? Give feedback.
All reactions