PEP 308: I liked the original proposal better

Sheila King usenet at thinkspot.net
Sat Feb 22 18:07:11 EST 2003


On Fri, 14 Feb 2003 08:48:15 -0500, mwilson at the-wire.com (Mel Wilson) wrote
in comp.lang.python in article <fOPT+ks/KzrS089yn at the-wire.com>:

> In article <mailman.1045198732.30827.python-list at python.org>,
> "Simon Wittber (Maptek)" <Simon.Wittber at perth.maptek.com.au> wrote:
> >
> >Greg Ewing wrote:
> >
> >>I'd like to put in a plea for re-instatement of the original proposal
> >>
> >>    x if C else y
> >>
> >>which I found to be particularly elegant.
> >
> >I have to agree. From my point of view this is the most pythonic
> >solution.
> >
> >Yes, the test is in the middle of the expression. The argument "This is
> >not
> >the way other languages do ternary expressions" is not a valid argument=20
> >against its use. Python is about about doing things the Right Way, not
> >the
> >common accepted way.
> 
> a = interesting_result if assert_condition else exceptional_value
> 
> puts, or can put, the main payload first, and can round up
> the nasty exceptions afterwards.  I liked it.
> 
>    Apparently enough people disliked it to have it removed
> from the ballot before the vote.

Having not had sufficient time to read all the discussion on this topic,
this post caught my eye and I did go to look at the current PEP 308. I am
disappointed to see that:

(1) not only has the original proposal been removed

(2) the "when" alternative is also not included.

I think that the presumption that those most vocal and frequently posting
in the newsgroup represent the overriding consensus may be flawed.

-- 
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/






More information about the Python-list mailing list