if/elif chain with assignment expressions

Paul Rubin http
Mon Jul 12 00:20:09 CEST 2004

steve holden <sholden at holdenweb.com> writes:
> Indeed, you  might think so. But this topic has been discussed
> exhaustively (which isn't to say you aren't about to hear a lot more
> about the subject) in this group, and the assignment operation is
> *not* an operator for specific reasons the FAQ attempts to make clear
> in
> http://www.python.org/doc/faq/general.html#why-can-t-i-use-an-assignment-in-an-expression

Yeah, I've seen those discussions before.  The if/elif/elif example was
something I hadn't seen in those discussions, and it came up in some
code I was writing yesterday, so I posted about it.

More information about the Python-list mailing list