Files
openide/python/testData/refactoring/makeFunctionTopLevel/methodInsertionPositionSameFileClassAndUsageNotTopLevel.after.py
Mikhail Golubev cd45e79ab2 PY-17265 Placement of inserted function is consistent with Move refactoring
Namely, if a function is being moved to another file it will be
inserted at its end unless there is a top-level usage of it. In this
case the generated function will be inserted right before the first
such usage so as not to produce unresolved references. If function
stays in the same file, it will be inserted after its original parent
statement i.e. another function or a class, again if there is no
conflicting usages.
2016-10-25 00:03:49 +03:00

10 lines
74 B
Python

def method():
pass
if True:
class C:
pass
method()