On Tue, 20 Jan 2004, 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: I use .setdefault all the time with non-list default arguments. The dict interface is getting complex enough that adding more clutter will make it even harder to teach optimal idiomatic Python to newbies. -Kevin -- Kevin Jacobs - Enterprise Systems Architect | What is an Architect? He designs Consultant to The National Cancer Institute | a house for another to build Dept. of Cancer Epidemiology and Genetics | and someone else to inhabit. V: (301) 954-0726 E: jacobske at mail.nih.gov | -- William Kahan
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