This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author camshaka
Recipients camshaka
Date 2018-07-31.10:51:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1533034295.33.0.56676864532.issue34291@psf.upfronthosting.co.za>
In-reply-to
Content
In the following code :

def g():
    return 0

def f():
    g = g()

f()

The call to g in f fails due to an UnboundLocalError, while I expected the assignment to hide the global definition of g. Note that if it is done in two subsequent calls, i.e. with :
def f():
    goo = g()
    g = 0

The first assignment still fails.
History
Date User Action Args
2018-07-31 10:51:35camshakasetrecipients: + camshaka
2018-07-31 10:51:35camshakasetmessageid: <1533034295.33.0.56676864532.issue34291@psf.upfronthosting.co.za>
2018-07-31 10:51:35camshakalinkissue34291 messages
2018-07-31 10:51:35camshakacreate