strange behavor....

Mark Wooding mdw at
Sun Nov 14 00:40:36 CET 2010

Steven D'Aprano <steve at> writes:

> On Sat, 13 Nov 2010 21:42:03 +0000, Mark Wooding wrote:
> > Dave Angel <davea at> writes:
> > 
> >> No, an (=) assignment is always an assignment.
> > 
> > No.  In `foo[0] = bar' it's a method call in disguise.
> How does that imply that can't also be an assignment?

Is `splat(34)' an assignment?  If so, I think the term's meaning is
grievously diluted.  I'd rather say that `splat(34)' might mutate a
value, or have side effects, and reserve the term `assignment' for the
job of explaining how variables work.  That seems pretty tricky, because
we're arguing about it a lot, so I think we need sharply defined
concepts so that we don't get more confused than we have to be.

> Of course, you're correct that it's not *necessarily* an assignment,


> I don't think it helps to overload newbies struggling with the basics
> with such pathological cases though.

I think that we're better off giving `newbies' a conceptual framework
which is robust, so that they can understand pathological situations
when they occur.

-- [mdw]

More information about the Python-list mailing list