[Python-ideas] Statements vs Expressions... why?

George Sakkis george.sakkis at gmail.com
Thu Sep 11 07:39:55 CEST 2008

On Thu, Sep 11, 2008 at 12:34 AM, Cliff Wells <cliff at develix.com> wrote:

On Wed, 2008-09-10 at 18:30 -0700, Josiah Carlson wrote:
> > On Wed, Sep 10, 2008 at 6:14 PM, Cliff Wells <cliff at develix.com> wrote:
> > > On Wed, 2008-09-10 at 17:16 -0600, Adam Olsen wrote:
> > [snip]
> > >> They're the use-case you need to justify
> > >> against the substantial changes you propose.
> > >
> > > I guess I don't see it as substantial to people who don't wish to use
> it
> > > (although it's quite substantial to people who do).  Overall, I think
> > > this is why I feel the change doesn't require a huge amount of
> > > justification: you aren't *forced* to use it, but if you need it, it's
> > > huge.  It doesn't impose any significant stylistic change on people who
> > > prefer the imperative style, but it opens vast doors for people wishing
> > > to approach problems from a functional path.
> >
> > Once language syntax is added to, changed, etc., it's very difficult
> > to remove those additions, changes, etc., even when the feature is
> > rarely used, ugly, and generally a bad idea (see back-quotes `x` for
> > repr(x) ).  This may not seem like a big deal to you, because you want
> > this feature, but for the rest of us who have little (arguably no) use
> > for the feature, adding semantics to syntax, or adding syntax =
> > additional mental overhead;
> Again I assert the opposite: that Python is currently forced to explain
> the arbitrary distinction that currently exists and that a significant
> amount of extra syntax and language features exist to work around that
> distinction.  People may not clamor for the change but there's quite a
> few newcomers to Python who must have the distinction explained to them.

For better or for worse, most people come to Python with imperative rather
than functional language background, so the distinction is either not even
realized or it usually seems "natural" when realized. Personally, I find
some features to be more natural as statements (e.g. it is typically obvious
whether to use a "for" loop or a list/gen. comprehension) but others
unnecessarily limiting (e.g. having to write "lambda x: x.__setitem__(0,1)"
instead of "lambda x: x[0]=1").

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20080911/7e3de00c/attachment.html>

More information about the Python-ideas mailing list