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

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

[Python-Dev] Single- vs. Multi-pass iterability [Python-Dev] Single- vs. Multi-pass iterabilityGreg Ewing greg@cosc.canterbury.ac.nz
Mon, 22 Jul 2002 11:35:38 +1200 (NZST)
Ka-Ping Yee <ping@zesty.ca>:

> I believe this is where the biggest debate lies: whether "for" should be
> non-destructive.

It's not the for-loop's fault if it's argument is of such a nature
that iterating over it destroys it.

Given suitable values for x and y, it's possible for evaluating "x+y"
to be a destructive operation.  Does that mean we should revise the
"+" protocol somehow to prevent this from happening? I don't think so.

This sort of thing is all-pervasive in Python due to its dynamic
nature. It's not something that can be easily "fixed", even if it were
desirable to do so.

Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	   | A citizen of NewZealandCorp, a	  |
Christchurch, New Zealand	   | wholly-owned subsidiary of USA Inc.  |
greg@cosc.canterbury.ac.nz	   +--------------------------------------+




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