Something in the function tutorial confused me.

greg greg at cosc.canterbury.ac.nz
Wed Aug 8 20:51:43 EDT 2007


Steve Holden wrote:

> For some reason your reply got right up my nose,

I'm sorry about that. Sometimes it's hard to judge the
level of experience with Python that a poster has. In
discussions about this particular topic, often it turns
out that the person is a newcomer to Python who is
using the wrong mental model of assignment, and your
comment about None being immutable suggested that this
is what was going on. If I was mistaken about that,
then I apologise.

While it may not have been what you meant, what you
*seemed* to be saying is that the result of a (plain)
assignment somehow depends on what was previously
bound to the name being assigned. I was just trying
to point out that this is not true.

The reason I suggested trying an example is that it
can be hard to talk about these things clearly when
you're not sure whether the words you're using, such
as "assignment", mean the same thing to the person
on the other end. The interpreter always interprets
things unambiguously.

--
Greg



More information about the Python-list mailing list