On Jan 20, 2004, at 9:17 AM, Raymond Hettinger wrote: > Here is anidea to kick around: > > Evolve and eventually replace dict.setdefault with a more specialized > method that is clearer, cleaner, easier to use, and faster. > > d.addlist(k, v) would work like d.setdefault(k, > []).append(v) -1 There are other reasons to use setdefault. This one is pretty common though, but I think a more generic solution could be implemented. Perhaps: d.setdefault(k, factory=list).append(v) ? -bob -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 2357 bytes Desc: not available Url : http://mail.python.org/pipermail/python-dev/attachments/20040120/09595ead/smime.bin
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