On 02/20/2015 12:51 AM, Jason Friedman wrote:

I'd still advise using my_list.sort() rather than sorted(), as you
don't need to retain the original.


Hmm.

Trying to figure out what that looks like.
If I understand correctly, list.sort() returns None.
What would I return to the caller?


    return_list = ....
    return_list.sort(key=..., reverse = True)
    return return_list


Oops, guess I'm not really returning a list, I'm returning an iterator.

Now you'll be returning a list, I believe.


--
DaveA
--
https://mail.python.org/mailman/listinfo/python-list

Reply via email to