PEP 308: some candidate uses cases from live code

Aahz aahz at pythoncraft.com
Mon Feb 10 14:55:26 EST 2003


In article <yu99n0l4q61f.fsf at europa.research.att.com>,
Andrew Koenig  <ark at research.att.com> wrote:
>
>Tony>Tony> Can you imagine explaining why this is good syntax:
>
>Tony> if x: print y
>Tony> else: print z
>
>Tony> And this isn't:
>
>Tony> if x: print x else: print y
>
>Anyone who wants to teach Python has to figure out how to explain it,
>as this is the state of affairs today.

That's half-true, in the context of this discussion.  Adding an extra
step to explain why

    print if x: x else: y

works is going to be a lot more difficult, IMO.
-- 
Aahz (aahz at pythoncraft.com)           <*>         http://www.pythoncraft.com/

Register for PyCon now!  http://www.python.org/pycon/reg.html




More information about the Python-list mailing list