I want to move a variable from local scope to object level. The new code should use self.user
and not user
like before:
class Foo(object):
def test_foo(self):
user=User()
...
user.do()
New code should look like:
class Foo(object):
def test_foo(self):
self.user=User() # I can remove this line by hand
...
self.user.do()
I tried to refactor>>rename from user
to self.user
but pyCharm says: "Inserted identifier is not valid"
How can I refactor this with pyCharm?