Files
Aleksei Kniazev c6e4181228 IDEA-CR-48018: inline function refactoring for python (PY-21287)
- ability to inline single/all invocations and keep/remove the declaration
- handled name conflicts of local and imported vars/functions
- cases when this refactoring is not applicable can be found in PyInlineFunctionHandler

(cherry picked from commit 40e298ba2b833a4408ee774628b84fe422468b91)

GitOrigin-RevId: dd3fab59800163b4f300b410cd28a62c1ee1b6f3
2019-07-02 06:52:16 +03:00

16 lines
302 B
Python

class MyClass:
def __init__(self, attr):
self.attr = attr
def __add__(self, other):
return MyClass(self.attr + other.attr)
def method(self):
print(self.attr)
print(self.attr)
my_class = (MyClass(1) + MyClass(2))
print(my_class.attr)
print(my_class.attr)