[Zope] Newbie - passing a list to an External Method
Dylan Reinhardt
zope@dylanreinhardt.com
17 Apr 2003 15:43:53 -0700
On Thu, 2003-04-17 at 13:23, Passin, Tom wrote:
> [ Dylan Reinhardt]
> > a = [1,2.3]
> > b = a
> > b = None
> > # now the value of a is None!
> >
>
> That is not right. a retains its value as expected. To prove it,
> here's a transcript from an IDLE session, with Py2.1.3 -
>
Ugh... there's nothing like making a newbie error when you try to point
out a newbie error. I probably shouldn't speculate and offer help at
the same time. Thanks for keeping me honest. :-)
> This is different from re-assigning the variable to reference something
> else like None.
You're right... no amount of in-place changes to a list object will
probably produce the error the OP is seeing. Theorizing how that change
might have been a side effect of something else was just off-base.
But we can still go back to theory #1: something in that external method
is *directly* re-assigning the "lines" variable to a non-sequence type
like None.
Dylan