28 Mar
2013
28 Mar
'13
4:49 a.m.
On 3/27/2013 10:29 PM, Shane Green wrote:
I'm not sure if there's anything inherently wrong with this idea, and I am well aware how incredibly easy it is to implement as an extension of the built-ins, but, I find it very useful to have /variations/ of list().append(obj) and set().add(obj) that return, obj.
There are other people who agree with you, but it is Guido's design decision from the beginning of Python that mutation methods do not return the object mutated. -- Terry Jan Reedy