Skip to content

Files

Latest commit

 

History

History
29 lines (18 loc) · 370 Bytes

used-prior-global-declaration.md

File metadata and controls

29 lines (18 loc) · 370 Bytes

Pattern: Name is used prior to global declaration

Issue: -

Description

Emitted when a name is used prior a global declaration which results in an error since Python 3.6.

Example of incorrect code:

CONST = 1

def test():
    CONST

    global CONST

Example of correct code:

CONST = 1

def test():
    global CONST
    CONST