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

[Python-Dev] iterator API in Py3.0

[Python-Dev] iterator API in Py3.0 [Python-Dev] iterator API in Py3.0Fredrik Lundh fredrik at pythonware.com
Sat Mar 4 07:27:41 CET 2006
Raymond Hettinger wrote:

> When teaching your classes, do you sense an aversion to using double
> underscore methods in regular code?  I sense an implied message that
> these methods are not intended to be called directly (i.e. the discomfort
> of typing x.__setitem__(k,v) serves as a cue to write x[k]=v instead;
> likewise, x.__int__() pushes towards int(x) instead).

the "if called magically, it should be __xxx__" rule is pretty worthless on
its own; you also need to answer the questions "called by whom ?" and
"never called by application code ?"

(from the sound of it, one could suspect that some posters here would
like all template methods in all standard library components to use the
__xxx__ form).

</F>



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