classification
Title: Create a real zip iterator object; not using itertools.izip
Type: Stage:
Components: Interpreter Core Versions: Python 3.0
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: gvanrossum Nosy List: gvanrossum, holmesbj
Priority: normal Keywords: patch

Created on 2006-08-24 22:14 by holmesbj, last changed 2008-01-06 22:29 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
iterzip.patch holmesbj, 2006-08-24 22:14 Patch against r51572
iterzip2.patch holmesbj, 2006-08-24 23:58 Revised patch against r51572
Messages (5)
msg50990 - (view) Author: Brian Holmes (holmesbj) Date: 2006-08-24 22:14
This patch adds a new zipiterobject type to
iterobject.c so that we do not import itertools.izip to
do our iterative zip.

There is test_zip.py added that is a stripped down
version of the itertools test.

It's my first patch so go easy on me. ;)
msg50991 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2006-08-24 22:23
Logged In: YES 
user_id=6380

I get a fatal error on the DECREF(ro) call at line 419 of
iterobject.c.  Investigating...
msg50992 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2006-08-24 22:59
Logged In: YES 
user_id=6380

Deleting that line (line 419) fixes the problem.  Then all
tests pass.  The patch has small style issues though, and
I'm not sure whether the zip iter ought to have a
__length_hint__ method at all.
msg50993 - (view) Author: Brian Holmes (holmesbj) Date: 2006-08-24 23:58
Logged In: YES 
user_id=1525681

Removed the __length_hint__ stuff which clears up the
uninitialized ro which caused the seg fault.
Changed zip_create_iter to _PyZip_Create.
Added result into zipiter_traverse and zipiter_dealloc.
msg50994 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2006-08-25 23:27
Logged In: YES 
user_id=6380

I've made some small changes and checked it in (r51620):

- fixed a few odd whitespace cases, e.g.
    for(i=0 ;
  into
    for (i = 0;

- disabled the specific type error

- rearranged the code so the type object is last;
  this reduces the number of forward decls needed

- shortened a long line
History
Date User Action Args
2008-01-06 22:29:46adminsetkeywords: - py3k
versions: + Python 3.0
2006-08-24 22:14:44holmesbjcreate