[Patches] [ python-Patches-1546297 ] Create a real zip iterator object; not using itertools.izip

SourceForge.net noreply at sourceforge.net
Sat Aug 26 01:27:08 CEST 2006


Patches item #1546297, was opened at 2006-08-24 18:14
Message generated for change (Comment added) made by gvanrossum
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1546297&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core (C code)
Group: Python 3000
>Status: Closed
>Resolution: Accepted
Priority: 5
Submitted By: Brian Holmes (holmesbj)
Assigned to: Guido van Rossum (gvanrossum)
Summary: Create a real zip iterator object; not using itertools.izip

Initial Comment:
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. ;)

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

>Comment By: Guido van Rossum (gvanrossum)
Date: 2006-08-25 19:27

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


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

Comment By: Brian Holmes (holmesbj)
Date: 2006-08-24 19:58

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

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2006-08-24 18:59

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

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

Comment By: Guido van Rossum (gvanrossum)
Date: 2006-08-24 18:23

Message:
Logged In: YES 
user_id=6380

I get a fatal error on the DECREF(ro) call at line 419 of
iterobject.c.  Investigating...

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

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


More information about the Patches mailing list