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/2006-September/068886.html below:

[Python-Dev] dict.discard

[Python-Dev] dict.discard [Python-Dev] dict.discardGustavo Niemeyer gustavo at niemeyer.net
Thu Sep 21 16:07:04 CEST 2006
> Would the argument be the key, or the pair?  I'd guess the key.

Right, the key.

> If so, there's the 2-arg flavor of dict.pop():
> 
>   >>> d = {}
>   >>> d.pop("key", None)
> 
> It's not terribly obvious, but does the job without enlarging
> the dict API.

Yeah, this looks good.  I don't think I've ever used it like this.

-- 
Gustavo Niemeyer
http://niemeyer.net
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