[issue42768] super().__new__() of list expands arguments

2020-12-28 Thread Richard Neumann
Richard Neumann added the comment: I could have sworn, that this worked before, but it was obviously me being tired at the end of the work day. Thanks for pointing this out and sorry for the noise. -- ___ Python tracker

[issue42768] super().__new__() of list expands arguments

2020-12-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Your problem is with list.__init__ method. It expects at most one argument. tuple does not have specialized __init__ method, it inherits it from object. All work is done in tuple.__new__. list does not have specialized __new__ method, it inherits it from

[issue42768] super().__new__() of list expands arguments

2020-12-28 Thread Richard Neumann
New submission from Richard Neumann : When sublassing the built-in list, the invocation of super().__new__ will unexpectedly expand the passed arguments: class MyTuple(tuple): def __new__(cls, *items): print(cls, items) return super().__new__(cls, items) class