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

holger krekel pyth at devel.trillke.net
Sat Feb 8 11:52:31 EST 2003


Andrew Koenig wrote:
> >> Most of the people opposed to PEP 308 are giving purely subjective
> >> reasons, disliking the whole idea so much that not only do they not
> >> want to use it, but they want to prevent other people from doing so as
> >> well.
> 
> holger> Let me guess which side you lean on :-)
> 
> I've already gone public:  I'm +0.8.  I like the overall idea, but
> have slight misgivings about the infix "if" .
> 
> holger> Actually, in my book people gave quite some good reasons 
> holger> for opposing the PEP:
> 
> holger>     a) it reads ugly especially in non-assignment statements
> 
> Subjective.

"Beautiful is better than ugly."
 
> holger>     b) it reuses a keyword which formerly was a clean indicator
> holger>        of a statement
> 
> Subjective, especially when you realize that "if" is already thus
> reused in list comprehensions.

Still "Readability counts."

> holger>     d) there are often better ways than doing the C-ish
> holger>        'x ? y : z' 
> 
> Agreed, but that's not an argument against PEP 308 unless you
> change "often" to "always".

"Special cases aren't special enough to break the rules."
     
> holger>     e) adds to the stuff you have to learn if you read others code
> 
> Agreed, but the importance of that is subjective.

Sure, why not use perl, then? 

> holger>     f) is not an important enough use case to warrant new syntax
> 
> Subjective.

Now I wonder what you might deem not to be subjective.  
I guess that the "design prinicples" of python in

    http://www.python.org/dev/culture.html

are mostly subjective categories, too, then.  
That's ok but i *like* them :-)

subjective-ly y'rs,

    holger





More information about the Python-list mailing list