A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2007-July/073786.html below:

[Python-Dev] itertools addition: getitem()

[Python-Dev] itertools addition: getitem() [Python-Dev] itertools addition: getitem()Guido van Rossum guido at python.org
Sun Jul 8 13:49:23 CEST 2007
On 7/8/07, Georg Brandl <g.brandl at gmx.net> wrote:
> Guido van Rossum schrieb:
> > How important is it to have the default in this API? __getitem__()
> > doesn't have a default; instead, there's a separate API get() that
> > provides a default (and I find defaulting to None more manageable than
> > the "_default = object()" pattern).
>
> getattr() has a default too, while __getattr__ hasn't...

Fair enough.

But I still want to hear of a practical use case for the default here.

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