simultaneous assignment

Bruno Desthuilliers bdesth.quelquechose at free.quelquepart.fr
Wed May 3 03:38:22 CEST 2006


John Salerno a écrit :
> bruno at modulix wrote:
> 
>> Now if I may ask: what is your actual problem ?
> 
> 
> Ok, since you're so curious. :)

Sorry !-)

> Here's a scan of the page from the puzzle book:
> http://johnjsalerno.com/spies.png
> 
> Basically I'm reading this book to give me little things to try out in 
> Python. There's no guarantee that this puzzle is even conducive to (or 
> worthy of) a programming solution.

Well, this is probably a good exercice in boolean logic - which is 
something very important in CS.

But my question (sorry, it may not have been clear) was more along the 
line of : "why do you worry about identity in the given snippet ?". 
Rebinding a name already bound to a given object doesn't affect other 
names bound to the same object. So in this case, multiple assignement is 
perfectly safe.



More information about the Python-list mailing list