Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
generator runout
#4
it's not an error. it's the way things a supposed to be. it was just annoying to me because i thought it was better to use a generator like this wherever i could. today i ran into an issue because i needed to count the number of iterations a generator had and i didn't think about it being exhausted. i just changed it to a list.

show me what my line-wrapped comprehension would look like with itertools.product. i think the way i have now (changed to be a list) looks clear and easy to read. my imagination of itertools.product is not like that.
Tradition is peer pressure from dead people

What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
Reply


Messages In This Thread
generator runout - by Skaperen - Oct-31-2019, 01:24 AM
RE: generator runout - by buran - Oct-31-2019, 07:05 AM
RE: generator runout - by perfringo - Oct-31-2019, 07:09 AM
RE: generator runout - by Skaperen - Oct-31-2019, 08:11 AM
RE: generator runout - by buran - Oct-31-2019, 08:36 AM
RE: generator runout - by Skaperen - Nov-01-2019, 01:01 AM
RE: generator runout - by DeaD_EyE - Oct-31-2019, 09:24 AM

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020