2009/9/17 Roberto Alsina <ralsina@???>:
> def firstTrue():
> yield True
> while True:
> yield False
>
> ft=firstTrue()
> print ft.next()
> print ft.next()
> print ft.next()
>>> ft = itertools.chain([True], itertools.cycle([False]))
>>> ft.next()
True
>>> ft.next()
False
>>> ft.next()
False
itertools FTW!
--
. Facundo
Blog:
http://www.taniquetil.com.ar/plog/
PyAr:
http://www.python.org/ar/
---------------------------------------------------------------------
Para dar de baja la suscripcion, mande un mensaje a:
pyar-unsubscribe@???
Para obtener el resto de direcciones-comando, mande un mensaje a:
pyar-help@???
PyAr - Python Argentina - Sitio web:
http://www.python.com.ar/