[Info] PEP 308 accepted - new conditional expressions
Dave Hansen
iddw at hotmail.com
Wed Oct 12 11:09:54 EDT 2005
On Wed, 12 Oct 2005 13:02:20 +0200, Piet van Oostrum <piet at cs.uu.nl>
wrote:
>>>>>> Paul Rubin <http://phr.cx@NOSPAM.invalid> (PR) wrote:
>
[...]
>
>>PR> Yeah, "if C then A else B" is a ancient tradition stretching from
>>PR> Algol-60 to OCAML, and who knows what all else in between. I'm not
>>PR> sure what Guido saw in the "A if C else B" syntax but it's not a big deal.
>
>I suspect it is because "if C then A else B" gives problems in the parser
>because it would have difficulty to distinguish this in time from the if
>statement. This is because the parser doesn't use a very strong formalism.
So lose the "if."
R = C then A else B
I don't think python uses the question mark for anything. Throw that
in, if it makes parsing easier:
R = C ? then A else B
Regards,
-=Dave
--
Change is inevitable, progress is not.
More information about the Python-list
mailing list