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

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

[Python-Dev] Single- vs. Multi-pass iterabilityGreg Ewing greg@cosc.canterbury.ac.nz
Thu, 18 Jul 2002 11:55:27 +1200 (NZST)
Guido:

> Likewise, the file needs a strong ref to the xreadlines, otherwise the
> following would create a new iterator in the second for loop, and lose
> data buffered by the first iterator.

To me, these problems are screaming out that the
buffer *shouldn't* be kept in the xreadlines object!

Maybe the xreadlines object's buffer should be kept
in the file object? Then it wouldn't matter if
multiple xreadlines objects were created, as
they'd all share the same buffer, and there would
be no reference loops.

Hmmm... then we're moving towards making the
file object and the xreadlines object be the
same object. What was the reason for not doing
that again? Was it just to avoid changing a lot
of code, or was there some reason it wouldn't
work?

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