How do I avoid this global SyntaxWarning?

Emile van Sebille emile at fenx.com
Sat Aug 25 18:15:31 CEST 2001


One way to get that message:

def test():
    a = 1
    global a

Look at your code to see how to fix it, but you probably will want to do
something like:

def test():
    global a
    a = 1

HTH,

--

Emile van Sebille
emile at fenx.com

---------
<gradha at iname.com> wrote in message news:iah8m9.pic.ln at 127.0.0.1...
> > Promptly most of my scripts give SyntaxWarnings under Python 2.1.1...
>
> Forgot to say exact warning message:
>
> ./test.py:0: SyntaxWarning: name 'expresion_include' is assigned to before
global declaration
>
> --
>  Grzegorz Adam Hankiewicz   gradha at terra.es   http://gradha.infierno.org




More information about the Python-list mailing list