On 04/05/14 11:31, Steven D'Aprano wrote:
On Sun, May 04, 2014 at 10:00:08AM +0100, Alan Gauld wrote:

For the specific case of sort you can always use
the sorted() function which does return a reference
(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 :-(


Perhaps you meant that it didn't copy the individual items inside the
list?

Nah, I just got it wrong!

--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to