On Mon, Jun 18, 2018 at 3:01 AM, Mikhail V <mikhail...@gmail.com> wrote: > The idea is to introduce new syntax for the list.append() method. > > > Syntax: > > Variant 1. > Use special case of index, namely omitted index: > > mylist[] = item
Creation of syntax cannot be done for just one type. So what would this mean (a) for other core data types, and (b) in the protocols? What dunder will be called, and with what arguments? For example: class Foo: def __setitem__(self, key, val): print("Setting", key, "to", val) x = Foo() x[] = 1 What should be printed? Will it come through __setitem__ or are you requiring a completely different dunder method? Regardless, I am still a strong -1 on introducing another way to spell list.append(). ChrisA _______________________________________________ Python-ideas mailing list Python-ideas@python.org https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/