Message122404
> 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. |
|
Date |
User |
Action |
Args |
2010-11-25 20:32:46 | eric.araujo | set | recipients:
+ eric.araujo, rhettinger, holdenweb, eric.smith, alex, michael.foord, docs@python, lukasz.langa |
2010-11-25 20:32:46 | eric.araujo | set | messageid: <1290717166.63.0.558809682567.issue10533@psf.upfronthosting.co.za> |
2010-11-25 20:32:43 | eric.araujo | link | issue10533 messages |
2010-11-25 20:32:43 | eric.araujo | create | |
|