This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eric.araujo
Recipients alex, docs@python, eric.araujo, eric.smith, holdenweb, lukasz.langa, michael.foord, rhettinger
Date 2010-11-25.20:32:43
SpamBayes Score 2.66202e-08
Marked as misclassified No
Message-id <1290717166.63.0.558809682567.issue10533@psf.upfronthosting.co.za>
In-reply-to
Content
> 4. I cannot come up with another typical integer value that would be
> useful, then again I've used "", [] and set() numerous times.
You can get '' with str as default factory and [] with list.

I think we agree on reclassifying this as a doc problem.  Proposal:

1) Add a small example in stdtypes.rst:dict section.

2) Add examples of giving dict or int to collections.defaultdict to get {} or 0 as default value.

3) Find a way to link to that example from the index.  It is not currently indexed because there is no dict.__missing__ method, hence no method markup that would trigger indexing.

4) Cross-link collections.rst:defaultdict, collections.rst:Counter and stdtypes.rst:__missing__ example.
History
Date User Action Args
2010-11-25 20:32:46eric.araujosetrecipients: + eric.araujo, rhettinger, holdenweb, eric.smith, alex, michael.foord, docs@python, lukasz.langa
2010-11-25 20:32:46eric.araujosetmessageid: <1290717166.63.0.558809682567.issue10533@psf.upfronthosting.co.za>
2010-11-25 20:32:43eric.araujolinkissue10533 messages
2010-11-25 20:32:43eric.araujocreate