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/2002-July/026783.html below:

[Python-Dev] Single- vs. Multi-pass iterability

[Python-Dev] Single- vs. Multi-pass iterability [Python-Dev] Single- vs. Multi-pass iterabilityFredrik Lundh fredrik@pythonware.com
Fri, 19 Jul 2002 18:07:21 +0200
aahz wrote:

> While technically true, that seems to be sidestepping the point from =
my
> POV.

really?  are you arguing that when Ping says that for-in shouldn't
destroy the target, he's really saying that python shouldn't allow
methods to have side effects if they can be called from an
expression used in a for-in statement?  why would he say that?

> I think that few people see for loops as inherently non-destructive
> due to the use case I presented above.

I think most people can tell the difference between an object and
a method with side-effects.  I doubt they would be able to get much
done in Python if they couldn't.

> Beyond that, the for loop is itself inherently mutating in Python
> older than 2.2

in what sense?  it calls the object's __getitem__ method with an
integer index value, until it gets an IndexError.  in what way is that
"inherently mutating"?

</F>





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