A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2009-March/086603.html below:

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

[Python-Dev] PEP 372 -- Adding an ordered directory tocollectionsready for pronouncement [Python-Dev] PEP 372 -- Adding an ordered directory tocollectionsready for pronouncementRaymond 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

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4