[ python-Bugs-955772 ] Nested generator terminates prematurely

SourceForge.net noreply at sourceforge.net
Tue May 18 06:02:49 EDT 2004


Bugs item #955772, was opened at 2004-05-18 13:02
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=955772&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Yitz Gale (ygale)
Assigned to: Nobody/Anonymous (nobody)
Summary: Nested generator terminates prematurely

Initial Comment:
def g(x, y):
  for i in x:
    for j in y:
      yield i, j

r2 = (0, 1)
[e for e in g(r2, g(r2, r2))]

Expected result:

[(0, (0, 0)), (0, (0, 1)), (0, (1, 0)), (0, (1, 1)),
 (1, (0, 0)), (1, (0, 1)), (1, (1, 0)), (1, (1, 1))]

Actual result:

[(0, (0, 0)), (0, (0, 1)), (0, (1, 0)), (0, (1, 1))]

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

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



More information about the Python-bugs-list mailing list