[Tutor] Keeping change-in-place vs. copy methods straight

Dave Angel davea at davea.name
Sun May 4 14:54:14 CEST 2014


Alan Gauld <alan.gauld at btinternet.com> Wrote in message:

>>> (not a copy!) to the sorted item.
>>
>> sorted() does make a copy of the list:
> 
> Really? That's a bummer.
> I assumed (never assume!) that it returned a reference to the original.
> I really, really, hate the way Python handles this :-(
> 

It's not clear to me what you would change. Would you only provide
 methods (like sort) that mangle their object? 


-- 
DaveA



More information about the Tutor mailing list