Global confusion

David Ascher da at ski.org
Tue Sep 28 18:49:03 EDT 1999


On Wed, 29 Sep 1999, skaller wrote:

> David Ascher wrote:
> [global directive]
> 
> > Side note 2: JPython does something else altogether.
> 
> Can you elaborate please?

I must withdraw the original statement.  In early versions of JPython,
there was no local tagging of assigned-to-variables, so, IIRC,

x = 'old'
def f():
  print x
  x = x + x
  print x
print x
f()
print x

resulted in

old
old
oldold
old

But I just tested it with a recent JPython and found that it too does the
local variable tagging.  Thanks for pointing out my error.

--david





More information about the Python-list mailing list