A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2004-January/042116.html below:

[Python-Dev] dict.addlist()

[Python-Dev] dict.addlist() [Python-Dev] dict.addlist()Kevin Jacobs jacobs at penguin.theopalgroup.com
Tue Jan 20 09:25:09 EST 2004
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


More information about the Python-Dev mailing list

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