[Python-Dev] PEP 372 -- Adding an ordered directory tocollectionsready for pronouncement

Raymond Hettinger python at rcn.com
Mon Mar 2 20:47:45 CET 2009


[Me]
> In this case, Armin wants to be able to pass in an ordered dictionary to functions that weren't designed with ordered dicts in 
> mind (config parser, json/yaml parsers, nose, unittest, etc.).  Those functions should be able to assume that all the usual 
> dictionary properties are still true.  In particular, those functions may make internal comparisons to a regular dict (perhaps as 
> a cached value) and would expect those comparisons to succeed.

One other thought:  I was intending to modify namedtuple's _asdict() method to return an OrderedDict but don't want to break any 
existing code that relies on the returned object having an order insensitive comparison.

A object that currently returns a dict should be able to return an OrderedDict without breaking anything.  The proposed change 
precludes this possibility as well as the ones mentioned above.


Raymond 



More information about the Python-Dev mailing list