[Python-ideas] list…pushed, or something

Terry Reedy tjreedy at udel.edu
Thu Mar 28 05:49:24 CET 2013


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




More information about the Python-ideas mailing list