News for hackers. Stuff that matters.
Re:Unpythonic Python by omaranto on Wednesday April 09, 2014 @11:46PM (#7564052)
I use this function to force evaluation of elements in a generator:

    def do(gen):
       for x in gen:
          pass
It evaluates all elements of a generator with storing them in memory. If you don't mind generating some garbage, you can just use the list function instead.

There are no comments on this comment yet.