Skip to content

Global declaration is ignored by method extraction #316

@chrisbarber

Description

@chrisbarber

Do method extraction on the g = 2 line:

g = None

def f():
    global g

    g = 2

f() 
print(g)

Actual

g = None

def f():
    global g

    _g()

def _g():
    g = 2

f()
print(g)

Expected

g = None

def f():
    global g

    _g()

def _g():
    global g
    g = 2

f()
print(g)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions