Re: global variable, ok for string, bad for int

2005-01-21 Thread Tim Roberts
francisl <[EMAIL PROTECTED]> wrote: > >I have a problem when I declare global variable. >If it is string, dict, array or tuple, everything goes fine, but with int, I >get an "used before declaration" error. Excuse me for being dubious, but I don't believe you. Both of the examples you posted wor

Re: global variable, ok for string, bad for int

2005-01-20 Thread Peter Hansen
francisl wrote: I have a problem when I declare global variable. If it is string, dict, array or tuple, everything goes fine, but with int, I get an "used before declaration" error. here a sample : vardict = {'un':1, 'deux':2} def print_value(): print vardict['un'] # ok, that works --