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/086630.html below:

[Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement

[Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncement [Python-Dev] PEP 372 -- Adding an ordered directory to collections ready for pronouncementRaymond Hettinger python at rcn.com
Mon Mar 2 23:36:32 CET 2009
[Nick Coghlan]
> The examples in the PEP used 'odict' (until recently), but the patch was
> for OrderedDict.

As an experiment, try walking down the hall asking a few programmers who aren't in this conversion what they think 
collections.odict() is?
Is it a class or function?  What does it do?  Can the English as second language folks guess what the o stands for?  Is it a builtin 
or pure python?  My guess is that the experiment will be informative.

When we use the class, we typically only spell-out the constructor once while actually using the returned object many times.  So, 
have we really saved any typing?

In the context of other applications, which is clearer?

    json.loads(jtext, object_pairs_hook=odict)
    config = ConfigParser(dict_type=odict)

or

    json.loads(jtext, object_pairs_hook=OrderedDict)
    config = ConfigParser(dict_type=OrderedDict)

I find the former to be non-communicative.


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