rope icon indicating copy to clipboard operation
rope copied to clipboard

Renaming the variable name of typing.NewType should also rename the string type name of the NewType declaration

Open lieryan opened this issue 3 years ago • 0 comments

Is your feature request related to a problem? Please describe.

When using type annotation to declare a typing.NewType, you have to pass in the type name as the first argument:

MyType = typing.NewType("MyType", int)

When you rename MyType -> NewMyType, currently rope leaves an invalid NewType declaration:

NewMyType = typing.NewType("MyType", int)

Describe the solution you'd like

rope should rename the string type name as well:

NewMyType = typing.NewType("NewMyType", int)

lieryan avatar Nov 25 '22 07:11 lieryan