Refactoring example with PyCharm
- Change variable name (in scope only)
examples/pycharm/calc.py
def add(x, y): z = x + y return z def multiply(x, y): z = x * y return z x = 2 y = 3 z = add(x, y) print(z) z = multiply(x, y) print(z)
- Extract method
def add(x, y): z = x + y return z def multiply(x, y): z = x * y return z x = 2 y = 3 z = add(x, y) print(z) z = multiply(x, y) print(z)