[Newbie] How to output dictionary sorted on content (not keys)

Alex Martelli aleax at aleax.it
Fri Jul 5 16:56:05 EDT 2002


Boudewijn Rempt wrote:
        ...
>>     auxdict.setdefault(count, []).append(name)
        ...
> I really should read the documentation for each new release... I

If you intend to use or need to support that release, that's a good
idea.  Or, read the Python Cookbook, which will be launched in 3
weeks at OSCON -- it covers many such novelties in the context
of complete recipes... I think it's a good way to learn about them
(and, of course, I _am_ utterly unbiased...:-).

> had completely missed the arrival of 'setdefault'. Probably means
> that I'm stuck in the 1.5.2 ages or something :-(.

I also have an article in the latest (July 2002) Linux Magazine about
the many benefits obtained from upgrading from 1.5.2 to 2.2, though
in the callouts, and here and there even in the text, they did manage
to mangle many of my "2.2"'s to "2.0", thus probably making the
point of the article a bit confused for most readers...


Alex




More information about the Python-list mailing list