Message122404
| 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. |
|