Does anyone else use this little idiom?

Troels Thomsen nejtak...
Sun Feb 3 12:50:42 EST 2008


>for action in repeat(f, n): action()
>I don't know how 'Pythonic' this would be...

agree, 
or this:

import itertools

def f1():
  print "hello"

[f() for f in itertools.repeat(f1,6)]


tpt



More information about the Python-list mailing list