None & Ellipsis
Fredrik Lundh
effbot at telia.com
Mon Feb 21 13:40:46 EST 2000
Moshe Zadka <moshez at math.huji.ac.il> wrote
> On Sat, 19 Feb 2000, Gerrit Holl wrote:
>
> > > > >>> t=('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i')
> > > > >>> t1, t2, None, t4, t5, None, None, t8, None = t
> > > > >>> None
> > > > 'i'
> > >
> > > >>> del None
> > > >>> None
> > > >>>
> >
> > Ah...! Is this behaviour documented!
>
> Yes. It's called the "Python 3 namespace rule".
exactly. and combined with the "local variables
are detected by static analysis" rule, things get
really weird. consider this:
def mylongfunction():
a = None
# ...
# a few hundred lines of computation
# ...
a = 1, 2, 3
None, None, b = a
this results in an exception. on what line?
</F>
More information about the Python-list
mailing list