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

Cameron Simpson cs at cskk.id.au
Tue Jun 12 20:24:15 EDT 2018


On 13Jun2018 02:42, Mikhail V <mikhailwas at gmail.com> wrote:
>On Tue, Jun 12, 2018 at 10:26 PM, Terry Reedy <tjreedy at udel.edu> wrote:
>> On 6/12/2018 10:54 AM, Mikhail V wrote:
>>> Though additional brackets look really confusing for this purpose,
>>> so I don't feel like using this seriously.
>>
>> Learning about lists means learning about slice assignment: replace a
>> sublist with another sequence.
>
>Yes I see, actually that is what I am saying - slice assignment has
>_replace_ semantics.

Yes, but note that replacing an _empty_ part of the list _is_ an insert!

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Python-ideas mailing list