[Python-ideas] Operator for inserting an element into a list

Michael Selik mike at selik.org
Fri Jun 15 21:38:36 EDT 2018

On Fri, Jun 15, 2018, 6:18 PM Mikhail V <mikhailwas at gmail.com> wrote:

> On Sat, Jun 16, 2018 at 3:47 AM, Michael Selik <mike at selik.org> wrote:
> > One of those links was discussing extend, not append.
> Yes and so what? ... What is different with append?

Luckily for extend, it's similar to the "obvious" semantics of ``a += b``
which is ``a = a + b``. Unfortunately for append, there's nothing quite
like it among the operators.

> The other wanted a
> > repeated append, best solved by a list comprehension.
> I think yuo should reread that one more thoroughly - I'll even paste here
> the text:
> Though append works just fine, I feel it is less clear than:

mylist[i] = 2*math.pi*radius*math.cos(phi[i])
> So your claim this ^ is not relevant?!

I read that sentence. No, it was not relevant, because the best answer was
to teach that person about list comprehensions, not to offer a new syntax.

Seriously I am starting to get tired of that style of conversation.

To be honest, I'm getting a little tired myself. I am trying to politely
suggest ways to strengthen your proposal even though I disagree with it.

I provided you links - you are not pleased again.

Are you aware that modifying the language is difficult, time consuming, and
the folks that do it aren't paid for their work? Further, any change is
likely to increase the maintenance burden on these same volunteers. Even
worse, tens of thousands of teachers will need to add more time to their
lesson plans to explain new features. Book authors will need to issue
errata and revised versions.

If you add that all together, in a sense, changing the parser to expand the
syntax would cost millions of dollars. Is that worth the change?

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

More information about the Python-ideas mailing list