sorteddict PEP proposal [started off as orderedict]

Jeremy Sanders jeremy+complangpython at jeremysanders.net
Wed Sep 26 17:21:19 CEST 2007


Mark Summerfield wrote:

> The sorteddict API that has emerged so far is (1) apart from the
> constructor, everything is identical to dict, (2) the constructor
> takes the same args as sorted(), so if you want to seed with a dict or
> with keywords you write sorteddict(dict(a=1,b=2), ...), (or you could
> create a sorteddict and use update() since that takes the same args as
> dict's constructor).

first() and last() would also be nice on a sorted dict.

Jeremy

-- 
Jeremy Sanders
http://www.jeremysanders.net/



More information about the Python-list mailing list