On 6/08/2013 1:49 PM, alex23 wrote:
Shouldn't that be:

     with open('/home/collier/pytest/__sort.TXT') as file:
         data = file.readlines()
         sorted(data, key=str.casefold, reverse=True)

I'm tempted to say "HINT #5: don't provide a solution without testing it
first" but that would be pretty obnoxious.

Even more so when I got it wrong myself :)

    data = sorted(file.readlines(), key=str.casefold, reverse=True)

I can never remember which one sorts in place and which doesn't.
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to