[Python-ideas] 'where' statement in Python?

Antoine Pitrou solipsis at pitrou.net
Wed Jul 21 00:48:06 CEST 2010

On Wed, 21 Jul 2010 00:28:03 +0200
Antoine Pitrou <solipsis at pitrou.net> wrote:
> I am worried that this complexifies Python syntax without any obvious
> benefit in terms of expressive power, new abstractions, or concision.
> There is a benefit (learning curve, readibility of foreign code) to a
> simple syntax.

I'll add another issue:

- currently, lexical blocks (indentation following a colon) are used
  for control flow statements; this proposal blurs the line and makes
  visual inspection less reliable

I also disagree with the rationale which states that the motivation
is similar to that for decorators or list comprehensions. Decorators
and list comprehensions add value by making certain constructs more
concise and more readable (by allowing to express the construct at a
higher level through the use of detail-hiding syntax); as for
decorators, they also eliminate the need for repeating oneself. Both
have the double benefit of allowing shorter and higher-level code.

The "given" syntax (I don't know how to call it: statement? postfix?
appendage?), however, brings none of these benefits: it is almost pure
syntactic sugar, and one which doesn't bring any lexical compression
since it actually increases code size, rather than decrease it.



More information about the Python-ideas mailing list