[Tutor] Why thus?

Arthur Siegel siegel@eico.com
Tue, 14 Mar 2000 17:25:32 -0500


> > # this fails (references local var that hasn't been
> > #               assigned/doesn't exist)
> > i = 4
> > def foo():
> >     print i   # "print global 'i'"
> ++++++++++++++++++++++++ local
> >     i = 6     # set local 'i'

I did see your point.  It is taking the situation I posed one step further.
Even with the print statement chronologically before the local assignment,
it
fails.

It did help to bring home the point Christian was making about what the
compiler
is up to.

Thanks.