PEP-308 a "simplicity-first" alternative

Dan Schmidt dfan at dfan.org
Tue Feb 11 23:02:45 CET 2003


Paul Rubin <http://phr.cx@NOSPAM.invalid> writes:

| holger krekel <pyth at devel.trillke.net> writes:
|> Inspired by "do the simplest thing that can possibly work"
|> i now think that 
|> 
|>         x and y else z
|> 
|> might just do it and avoid the need for a new construct.  
|> It's a very minor change just for fixing the problem at hand.  
|> It should be obvious what it does.  
|
| I find it very confusing and don't think I'd ever get used to it.

Yeah, me neither.  But at least I don't think I'd be tempted to
rewrite other people's code to get rid of it, as I am with the and/or
trick.

I don't think I will ever fully get used to 'and' being of type

  (bool, T) -> T

rather than

  (bool, bool) -> bool

It just doesn't read naturally to me.

| I really dislike that type of cutesy-ness that is sometimes found in
| Python (the % string operator is another example).

Oh, I love the % operator.  I don't have an issue with it probably
because 1) % is a funny enough character that I don't immediately
think of 'mod' when I see it, and 2) % kinda makes sense because it is
specifying the values of the %-expressions in the string.

Dan

-- 
http://www.dfan.org




More information about the Python-list mailing list