sorting ascending/descending with operator.attrgetter

Steven D'Aprano steven at
Thu Apr 1 06:28:32 CEST 2010

On Wed, 31 Mar 2010 22:19:27 -0400, Steve Holden wrote:

> Steven D'Aprano wrote:
>> 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."
> But you surely will admit that you could be held to, well rather than
> "be pedantic" perhaps we should say "tend towards the literal"?

I wouldn't so much say "literal" as "precise".


> I'm the same myself, and I know from personal experience that while I am
> (simply?) seeking accuracy and truth it sometimes bugs the hell out of
> people ...

If you think I'm pedantic, you should see some of the guys I work with. 
I'm frequently on the receiving end of technical corrections. Yes, it's 
annoying to be in full flow explaining something, only to have somebody 
point out that you've made a silly mistake, or totally got something 
wrong, or what you've been calling a NAT device (including to the client) 
for a week is actually a NAS device *cough*. Annoying or not, if somebody 
had corrected me earlier, I wouldn't have looked quite so ignorant for 
quite so long, so all things considered I'd prefer to have my mistakes 
pointed out so I can stop making them.

> It's a geek thing.

Heavens, geeks on a programming forum! Who could possibly have expected 
such a thing?


More information about the Python-list mailing list