>> Need I continue?  Or is the dead still dead?

Since 'a if b else c' is not obviously dead, I will summarize my argument 
against it thusly:

It is ambiguous to people because it is can be parsed (by people, who are 
not automatons) as either '(a if) b (else c)' or 'a (if b) (else c)'.  The 
first parsing, seeing a as the conditional rather than the consequent, as 
in the the second, is at least as reasonable as the second given precedents 
in both other algorithm languages and natural languages (in English, at 
least, but I suspect others also).

Ambiguity sometimes leads to discomfort.  As important, it sometimes leads 
to bugs either in writing or reading.  The impetus for this discussion was 
a real-life buggy example of the and/or construct.   Its replacement should 
be something not similarly bug-prone, even if for a different reason.

Terry J. Reedy



_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to