assignment in if

Edward Elliott nobody at 127.0.0.1
Tue May 2 21:00:01 EDT 2006


Roy Smith wrote:
> decision.  In Python, assignment is not an operator with side effects like
> in C or Java, but a statement.  

<nitpick> assignemnt is actually an expression in those languages, not a
statement. </nitpick>

> The lack of embedded assignments leads to slightly more verbose code in
> situations like this, but on the other hand, it avoids the typical C
> disaster of writing a whole function as a one liner.

Writing disasters in python just takes a little more creativity. ;)




More information about the Python-list mailing list