On Wed, 03 Mar 2010 15:41:34 -0500
Dave Angel da...@ieee.org wrote:
John wrote:
Hi,
I just read a few pages of tutorial on list comprehenion and generator
expression. From what I gather the difference is [ ] and ( ) at the
ends, better memory usage and the something the tutorial
Am Mittwoch, 3. März 2010 21:41:34 schrieb Dave Angel:
John wrote:
Hi,
I just read a few pages of tutorial on list comprehenion and generator
expression. From what I gather the difference is [ ] and ( ) at the
ends, better memory usage and the something the tutorial labeled as lazy
On Fri, 5 Mar 2010 07:57:18 am Andreas Kostyrka wrote:
A list comprehension builds a whole list at one time. So if the
list needed is large enough in size, it'll never finish, and
besides, you'll run out of memory and crash. A generator
expression builds a function instead which *acts*
On Thu, 4 Mar 2010 21:57:18 +0100
Andreas Kostyrka andr...@kostyrka.org wrote:
I would rather write it:
x_it = iter(x) # get an iterator for x
try:
while True:
i = x_it.next()
print i
except StopIteration:
pass
x_it = iter(x) # get an iterator for x
while True:
Hi,
I just read a few pages of tutorial on list comprehenion and generator
expression. From what I gather the difference is [ ] and ( ) at the
ends, better memory usage and the something the tutorial labeled as lazy
evaluation. So a generator 'yields'. But what is it yielding too?
John
John wrote:
Hi,
I just read a few pages of tutorial on list comprehenion and generator
expression. From what I gather the difference is [ ] and ( ) at the
ends, better memory usage and the something the tutorial labeled as lazy
evaluation. So a generator 'yields'. But what is it yielding