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

Mikhail V mikhailwas at gmail.com
Fri Jun 15 19:42:00 EDT 2018

Now I have slightly different idea. How is about special-casing of this
as a shortcut for append:

L[] = item

Namely just use the fact that empty slice is SyntaxError now.

I understand this is totally different approach than operator
overloading and maybe
hard to implement, but I feel like it looks really appealing.
And it is quite intuitive imo. For me the syntax reads like:
"add new empty element and this element will be "item".


More information about the Python-ideas mailing list