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

Chris Angelico rosuav at gmail.com
Tue Jun 12 18:51:57 EDT 2018


On Wed, Jun 13, 2018 at 5:25 AM, Michael Selik <mike at selik.org> wrote:
> On Tue, Jun 12, 2018 at 11:08 AM Mikhail V <mikhailwas at gmail.com> wrote:
>>
>> On Tue, Jun 12, 2018 at 7:42 PM, Clint Hepner <clint.hepner at gmail.com>
>> wrote:
>>
>> So the idea was about an insert/append operator.
>> Which would use augmented operator. The operator may be
>> /= or ^=. (I like ^= more, so I'll put here example with it).
>
>
> The "/" operator means divide. How do you divide a list?
> The "^" operator means exclusive-or. Again, strange concept for a list.

I agree about XORing a list, but dividing a list could conceivably be
implemented to split a list into parts. For instance:

low, high = list(range(10)) / 2

But it wouldn't mean "insert". Also, I can't imagine an augmented
division operator being useful, but others may disagree.

ChrisA


More information about the Python-ideas mailing list