Return value of an assignment statement?

Jeff Schwab jeff at schwabcenter.com
Thu Feb 21 19:19:09 EST 2008


Terry Reedy wrote:
> "Jeff Schwab" <jeff at schwabcenter.com> wrote in message 
> news:5sudnTSXrZY0aCDanZ2dnUVZ_rKtnZ2d at comcast.com...
> 
> | That's the same behavior I would expect in C, on the grounds that C
> | What I found confusing at first was
> | that the same variable will either directly store or merely refer to an
> | object, depending on the type of the object:
> 
> Since names and collection slots always refer to objects, I find the above 
> confusing.  Can you clarify what difference you percieve?

a += b

Whether a refers to the same object before and after that statement 
depends on what type of object it referred to before the statement.



More information about the Python-list mailing list