Mikhail V wrote:
L ^= item is L.append(item) or L += [item]
Okay, that achieves an in-place append, but it's not exactly obvious to the unenlightened what it does, whereas append() is pretty self-explanatory. Also, using the slice version to do an insert L[i:i] ^= item is not as efficient as it looks like it should be, because it creates an empty list, appends the item to it and then splices that back into the list. And you have to write the index twice. Whereas L.insert(i, item) doesn't have any of those problems, and again is mostly self-explanatory. Python is not Perl. Not every operation that you use more than once in a blue moon needs to have its own operator. -- Greg _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/