simultaneous assignment

John Salerno johnjsal at NOSPAMgmail.com
Tue May 2 12:58:44 EDT 2006


Is there a way to assign multiple variables to the same value, but so 
that an identity test still evaluates to False?

e.g.:

 >>> w = x = y = z = False
 >>> w
False
 >>> x
False
 >>> w == x
True
 >>> w is x
True         # not sure if this is harmful

The first line above is the only way I know to do it, but it seems to 
necessarily lead to the true identity test.



More information about the Python-list mailing list