2009/9/17 Roberto Alsina <ralsina@netmanagers.com.ar>
A ver...
def firstTrue():
yield True
while True:
yield False
ft=firstTrue()
print ft.next()
print ft.next()
print ft.next()
Produce
True
False
False
y es un poco más pitónico ;-)
--
("\''/").__..-''"`-. . Roberto Alsina
`9_ 9 ) `-. ( ).`-._.`) KDE Developer (MFCH)
(_Y_.)' ._ ) `._`. " -.-' http://lateral.netmanagers.com.ar
_..`-'_..-_/ /-'_.' The 6,855th most popular site of Slovenia
(l)-'' ((i).' ((!.' according to alexa.com (27/5/2007)
---------------------------------------------------------------------
Para dar de baja la suscripcion, mande un mensaje a:
pyar-unsubscribe@decode.com.ar
Para obtener el resto de direcciones-comando, mande un mensaje a:
pyar-help@decode.com.ar
PyAr - Python Argentina - Sitio web: http://www.python.com.ar/