>
>
> print(list(uneven_squares(10,10000))[2:10]) #slows as y gets bigger, then
> dies
>
>
You'll want to stick with sequence operations that do not force the entire
generator's output.  In this specific case, try itertools.islice.
http://docs.python.org/2/library/itertools.html#itertools.islice
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to