Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Global declaration is ignored by method extraction #316

Closed
chrisbarber opened this issue Oct 26, 2020 · 1 comment
Closed

Global declaration is ignored by method extraction #316

chrisbarber opened this issue Oct 26, 2020 · 1 comment

Comments

@chrisbarber
Copy link

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)
@lieryan
Copy link
Member

lieryan commented Sep 18, 2021

Closing. This is now fixed by #392.

@lieryan lieryan closed this as completed Sep 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants