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

[Python-Dev] defaultdict and on_missing()

[Python-Dev] defaultdict and on_missing() [Python-Dev] defaultdict and on_missing()Thomas Wouters thomas at xs4all.net
Thu Feb 23 22:45:19 CET 2006
On Wed, Feb 22, 2006 at 01:13:28PM -0800, Michael Chermside wrote:

> Haven't we learned from regrets over the .next() method of iterators
> that all "magically" invoked methods should be named using the __xxx__
> pattern? Shouldn't it be named __on_missing__() instead?

I agree that on_missing should be __missing__ (or __missing_key__) but I
don't agree on the claim that all 'magically' invoked methods should be
two-way-double-underscored. __methods__ are methods that should only be
called 'magically', or by the object itself. 'next' has quite a few usecases
where it's desireable to call it directly (and I often do.)

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
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