[Python-Dev] PEP 265 - Sorting dicts by value

Andrew Durdin adurdin at gmail.com
Mon Sep 13 06:21:38 CEST 2004


On Mon, 13 Sep 2004 12:29:11 +1000, David Harrison
<dave.l.harrison at gmail.com> wrote:
> 
> In the sense that items() can still be used as before, it remains
> consistent.  However since the same argument could be used to equally
> promote the modification of other  dict functions to accept such
> arguments - such as keys(values_first=0)  - to make the change to
> items() alone is (in my humble opinion) inconsistent.
> But that's just my opinion, others may feel differently.

To me, neither mydict.keys(values_first=whatever) nor
mydict.values(values_first=whatever) make any sense: these methods
return a list of only keys or only values, so saying "values first"
when you're getting a list of keys is meaningless.


More information about the Python-Dev mailing list