attaching names to subexpressions

Devin Jeanpierre jeanpierreda at gmail.com
Sun Oct 28 04:12:12 EDT 2012


On Sun, Oct 28, 2012 at 2:59 AM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> On Sun, 28 Oct 2012 01:57:45 -0400, Devin Jeanpierre wrote:
>
>> We have a problem, and two solutions. Solution 1 has downside A, and
>> solution 2 has downside B. If he complains about downside A, you say,
>> well, use solution 2. If he complains about downside B, you say, well,
>> use solution 1.
>>
>> What if he wants to avoid both downsides A and B? What solution does he
>> use then?
>
> "I want to have my cake, and eat it too." Every solution has some
> downside.

And yet you claimed all of their problems could be solved, without
adding any new syntax, "trivially".

Perhaps what you meant is that it's trivial to ignore their concerns
and use existing syntax.

> Just because no other solution is perfect (whatever that
> means!) doesn't mean we must keep adding more and more ways to solve the
> same problem into a language.

A fair point.

> The proposed solution, assignment as an expression, has multiple
> downsides:

Almost all of your "downsides" are nonspecific costs to implementing
new features. Which is to say, you can't think of any downside to this
approach at all, other than it being "open to abuse".

On the other hand, it'd probably be pretty useless if it weren't. :)

> All these downsides make the barrier to entry for new syntax very high.
> Python is a 20 year old mature language. Most, perhaps all, of the low-
> hanging fruit syntax-wise has been picked.

Absolutely. Especially considering that this is a "small" and obvious
change to Python, I hope nobody is holding their breath for this to be
added.

> Don't be surprised when
> there is opposition to adding new syntax. With very few exceptions, new
> syntax has real costs and little or questionable benefit.

Surprised? I think you've given me this speech twice now.

-- Devin



More information about the Python-list mailing list