sorteddict PEP proposal [started off as orderedict]
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.
More information about the Python-list