mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 15:50:53 +07:00
- 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
26 lines
429 B
Python
26 lines
429 B
Python
class MyClass:
|
|
|
|
def do_stuff(self, x, y):
|
|
print(x)
|
|
print(y)
|
|
return self.for_inline(x, y)
|
|
|
|
def for_inline(self, a, b):
|
|
self.do_something_else()
|
|
if a:
|
|
print(a)
|
|
elif b:
|
|
print(b)
|
|
else:
|
|
print("nothing")
|
|
return a, b
|
|
|
|
def do_something_else(self):
|
|
pass
|
|
|
|
|
|
x = 1
|
|
y = 2
|
|
cls = MyClass()
|
|
res = cls.for_in<caret>line(x, y)
|