sorting ascending/descending with operator.attrgetter

Steven D'Aprano steven at REMOVE.THIS.cybersource.com.au
Wed Mar 31 21:34:36 EDT 2010


On Wed, 31 Mar 2010 17:21:18 -0700, Patrick Maupin wrote:

> Doesn't matter though.  The OP was sorting lists, not strings, so he
> knew what I meant.

I have found that when people ask basic questions about fundamental 
Python operations like sorting, it is risky to assume that they will know 
what I meant if I say something different.

Since I've been on both the giving and receiving end of carelessly 
inaccurate answers, I know how frustrating it is to spend significant 
time trying to work out what I was doing wrong, only to be told much 
later "Oh, I meant you should do Y, not X. I thought you would understand 
what I meant."



-- 
Steven



More information about the Python-list mailing list