Problem with generator expression and class definition

M

Maric Michaud

I faced a strange behavior with generator expression, which seems like a bug, for both
python 2.4 and 2.5 :
.... a = 1, 2, 3
.... b = 1, 2, 3
.... C = list((e,f) for e in a for f in b)
....
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 4, in A
.... a = 1, 2, 3
.... b = 1, 2, 3
.... C = [ (e,f) for e in a for f in b ]
....[(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)]

Any comment ? I'm ready to report it as a bug if there is no objection.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top