[Patches] [ python-Patches-583235 ] make file object an iterator

noreply@sourceforge.net noreply@sourceforge.net
Mon, 05 Aug 2002 14:39:03 -0700


Patches item #583235, was opened at 2002-07-18 02:50
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=583235&group_id=5470

Category: Core (C code)
Group: Python 2.3
>Status: Closed
>Resolution: Duplicate
Priority: 5
Submitted By: Alex Martelli (aleax)
Assigned to: Nobody/Anonymous (nobody)
Summary: make file object an iterator

Initial Comment:
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


----------------------------------------------------------------------

>Comment By: Guido van Rossum (gvanrossum)
Date: 2002-08-05 17:39

Message:
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.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=583235&group_id=5470