This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: make file object an iterator
Type: Stage:
Components: Interpreter Core Versions: Python 2.3
process
Status: closed Resolution: duplicate
Dependencies: Superseder:
Assigned To: Nosy List: aleax, gvanrossum
Priority: normal Keywords: patch

Created on 2002-07-18 06:50 by aleax, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
patch.diff aleax, 2002-07-18 06:50 patch in python/dist/src
Messages (2)
msg40614 - (view) Author: Alex Martelli (aleax) * (Python committer) Date: 2002-07-18 06:50
As per python-dev discussion july 17 2002 & earlier, I 
reworked Oren's patch to remove a reference loop 
between file object and xreadlines object (making the 
reference xreadl.->fileob non-addref'd when and only
when the xreadlines object is being internally held by
the fileob), make f.readline interop with f.next (the former
delegating to the latter iff f is holding an xreadl. obj), make
f.seek remove the xreadl.obj that f is holding (if any), and
removing the optimization of caching xreadlines function
pointers as static variables in functions of fileobject.c.

Also added tests for this functionality to test_file.py.


Alex
msg40615 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2002-08-05 21:39
Logged In: YES 
user_id=6380

I'll close this as "duplicate". Oren has since submitted a
better patch that re-implements the needed buffering in the
file object without the need to reference xreadlines at all.
That sounds like a better solution.
History
Date User Action Args
2022-04-10 16:05:30adminsetgithub: 36908
2002-07-18 06:50:34aleaxcreate