Skip to content

[QUESTION] what is extract_block supposed to do? #442

@AckslD

Description

@AckslD

I'm just trying to understand the different features and tried some things on this python snippet:

def f(a, b):
    if True:
        y = a + b
        z = y + b
    return z + y

If I call Refactor extract_block (either in visual mode or not) and give the new function the name test I get:

def test(a, b):
    if True:
        y = a + b
        z = y + b
    return z + y



def f(a, b):
    test(a, b)

which I'm not sure what's the purpose, seems like just a copy of the function and f is now broken since it doesn't return anything.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions