python3: 'where' keyword

Carl Banks invalidemail at aerojockey.com
Mon Jan 10 02:13:10 CET 2005


Paul Rubin wrote:
> Nick Coghlan <ncoghlan at iinet.net.au> writes:
> > Trying to push it a level further (down to expressions) would, IMO,
be
> > a lot of effort for something which would hurt readability a lot.
>
> I think we should just try to do things in a simple and general way
> and not try to enforce readability.  For example, the
> slightly-overcomplex code that I proposed might have been generated
by
> a macro, or even by a compiler from some other language.  No human
> would ever have to look at it, so it doesn't matter whether it's
> easily readable.  There's no reason to add needless constraints on
the
> language just to make writing ugly code difficult.  The main goal
> should be to make writing clear code easy, not to worry about whether
> someone might also write ugly code.


I couldn't disagree more.  I belive in the Zen of Python.  I believe
the Zen of Python is the major factor responsible for  Python's
success.  I believe that moving away from the Zen of Python will only
diminish the language.

And I think allowing a where statement inside in expression goes
against the Zen in so many ways it isn't even funny.

Beautiful is better than ugly.
Simple is better than complex.  (Note that simple means different
things to different people: for me, and I believe, for the Zen of
Python, it means simple for a human to understand.)
Flat is better than nested. (Seems to be the official Zen if effect
here.)
Readability counts. (Yes, if something's unreadable enough, I hope it's
not in the language, not merely that no one uses it.)
Special cases aren't special enough to break the rules.  (Heretofore,
Python has never had a nested block inside an expression; doing that
would make it a special case.)


I don't want Python to be LISP.  I don't think it's an admirable goal
for Python to strive to be like LISP for the sake of being like LISP,
or for the sake of being general or pure.  If Python borrows something
from LISP, it should be because that aspect of LISP supports the Zen of
Python.

If I wanted to use LISP, I'd be using LISP.  But I like my statements
and expressions distinct.  I like things that belong in statements to
stay in statements, and things that belong in expressions to stay in
expressions.

And a suite, be it a def statement, a where block, or whatever, belongs
in a statement, not an expression.



-- 
CARL BANKS




More information about the Python-list mailing list