a = b = 1 just syntactic sugar?

Ed Avis ed at membled.com
Tue Jun 3 17:17:14 EDT 2003


Joshua Marshall <joshway_without_spam at myway.com> writes:

>>if b = 1 returns b, then why can't you say  a = (b = 1)  ?
>
>It's incorrect.  "b = 1" does not return (evaluate to) anything,
>because it's not an expression.

Is there a way to write an expression which sets b and does return
something?

-- 
Ed Avis <ed at membled.com>




More information about the Python-list mailing list