The meaning of "=" (Was: tough-to-explain Python)

Aahz aahz at pythoncraft.com
Wed Jul 8 17:59:19 CEST 2009


In article <h32eoh$ql8$1 at reader1.panix.com>, kj  <no.email at please.post> wrote:
>
>OK, so, scratching from my original post the case
>
><identifier>.<identifier> = <expression>
>
>(as being a special case of <identifier> = <expression>), still,
>to the extent that I understand your post, the "=" in
>
>  x = 1
>
>means something fundamentally different (in terms of Python's
>underlying implementation) from the "=" in
>
>  y[0] = 1
>
>No?

No.  ;-)  What's different is not the ``=`` but the construction of the
assignment target before ``=`` gets executed.  Consider also this:

x, y = y, x
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

"as long as we like the same operating system, things are cool." --piranha



More information about the Python-list mailing list