> 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
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