Return value of an assignment statement?

Steve Holden steve at holdenweb.com
Thu Feb 21 19:16:15 EST 2008


Jeff Schwab wrote:
> bruno.desthuilliers at gmail.com wrote:
[...]
>> Now there's no reason to feel nervous about this. All you have to
>> remember is that Python never copy anything unless explicitely asked
>> for.
> 
> It's not that simple.  After a statement like:
> 
> 	a = b
> 
> Whether a and b denote the same object depends on what kind of object b 
> represented in the first place.

Surely this is exactly wrong. Is there a single example you can think of 
where

a = b
assert a is b, "Oops!"

would raise and exception? Perhaps you meant to use an augmented 
assignment operation?

regards
  Steve
-- 
Steve Holden        +1 571 484 6266   +1 800 494 3119
Holden Web LLC              http://www.holdenweb.com/




More information about the Python-list mailing list