For review: PEP 308 - If-then-else expression

Roy Smith roy at panix.com
Sun Feb 9 10:54:23 EST 2003


In article <wzwuk9bh58.fsf at nono.cs.uu.nl>,
 Piet van Oostrum <piet at cs.uu.nl> wrote:

> >>>>> aahz at pythoncraft.com (Aahz) (A) wrote:
> 
> A> From my POV, usable orthogonality is related to simplicity.  Adding a
> A> ternary operator reduces Python's simplicity, and therefore a certain
> A> amount of orthogonality.  Listcomps fit "practicality beats purity", but
> A> I just don't see that *in* *the* *aggregate* for ternaries.
> 
> I think conditional expressions add to the orthogonality. You have
> expressions and statements in Python, but statements can be conditional
> and expressions cannot. This is unorthogonal. Algol 68 was orthogonal in
> this respect, what you could do in statements was the same as what you
> could do in expressions (there being no difference).

Well, if we're going to take that argument, then we should also be 
considering assignment as an expression so people can write C-style 
loops such as "while x = foo():".  Otherwise, it's just another special 
case, which makes it more complex for people to understand how the 
language works.




More information about the Python-list mailing list