Short example code:
def test(self, str): txt = "str" return str
Right-clicking on str variable on the first line -> refactor -> rename changes also the second line to txt = "newvar".
I would like to extend the example:
@decorate(name="name") def func(): name = "name" print(name)
Renaming the 'name' variable inside func() to 'name2' would result in the following code:
@decorate(name2="name2") def func(): name2 = "name2" print(name2)
You seem to have CSS turned off. Please don't fill out this field.
This is sometimes what you want, though:
def func(newval): if newval >= 10: raise ValueError("newval must be less than 10")
@sirjis
In your example you use the variable being refactored whereas in the original it's part of string literal which is different type of entity.
View and moderate all "bugs Discussion" comments posted by this user
Mark all as spam, and block user from posting to "(deprecated) Please use https://www.brainwy.com/tracker/PyDev/"
I would like to extend the example:
@decorate(name="name")
def func():
name = "name"
print(name)
Renaming the 'name' variable inside func() to 'name2' would result in the following code:
@decorate(name2="name2")
def func():
name2 = "name2"
print(name2)
This is sometimes what you want, though:
def func(newval):
if newval >= 10:
raise ValueError("newval must be less than 10")
@sirjis
In your example you use the variable being refactored whereas in the original it's part of string literal which is different type of entity.