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-February/061319.html below:

[Python-Dev] Proposal: defaultdict

[Python-Dev] Proposal: defaultdict [Python-Dev] Proposal: defaultdictGuido van Rossum guido at python.org
Sat Feb 18 01:20:46 CET 2006
On 2/17/06, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> That's why I think has_key and in should return True for any key.
> This leaves keys(), items(), and values(). From a pure point of
> view, they should return infinite sets. Practicality beats purity,
> so yes, d[k] could be considered a modifying operation.

I think practicality beats purity even for has_key/in; IMO these
operations are more useful when they match keys() instead of always
returning True. But someone should start writing some code to play
with this.

I have a working patch (including a hack for PyDict_GetItem()):
python.org/sf/1433928

So there's no excuse to be practical now.

--
--Guido van Rossum (home page: http://www.python.org/~guido/)
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