On 1/23/2010 9:44 AM, Roald de Vries wrote:
Dear all,
I sometimes want to use an infinite while loop with access to the loop
index, like this:
def naturals():
i = 0
while True:
yield i
y += 1
for i in naturals():
print(i)
I assume a function like 'naturals' already exists, or a similar
constr
On Jan 23, 2010, at 3:58 PM, Mark Dickinson wrote:
On Jan 23, 2:44 pm, Roald de Vries wrote:
I assume a function like 'naturals' already exists, or a similar
construction for the same purpose. But what is it called?
itertools.count()
On Jan 23, 2010, at 4:04 PM, Jan Kaliszewski wrote:
On Jan 23, 2010, at 3:49 PM, Diez B. Roggisch wrote:
Am 23.01.10 15:44, schrieb Roald de Vries:
Dear all,
I sometimes want to use an infinite while loop with access to the
loop
index, like this:
def naturals():
i = 0
while True:
yield i
y += 1
for i in naturals():
print(i)
I assume a fu
On Jan 23, 2010, at 3:50 PM, Grant Edwards wrote:
On 2010-01-23, Roald de Vries wrote:
Dear all,
I sometimes want to use an infinite while loop with access to the
loop
index, like this:
def naturals():
i = 0
while True:
yield i
y += 1
for i in naturals():
print(i)
I
23-01-2010 o 15:49:23 Diez B. Roggisch wrote:
Am 23.01.10 15:44, schrieb Roald de Vries:
Dear all,
I sometimes want to use an infinite while loop with access to the loop
index, like this:
def naturals():
i = 0
while True:
yield i
y += 1
for i in naturals():
print(i)
I assume a function lik
On Jan 23, 2:44 pm, Roald de Vries wrote:
> I assume a function like 'naturals' already exists, or a similar
> construction for the same purpose. But what is it called?
itertools.count()
--
Mark
--
http://mail.python.org/mailman/listinfo/python-list
On 2010-01-23, Roald de Vries wrote:
> Dear all,
>
> I sometimes want to use an infinite while loop with access to the loop
> index, like this:
>
> def naturals():
> i = 0
> while True:
> yield i
> y += 1
>
> for i in naturals():
> print(i)
>
> I assume a function like '
Am 23.01.10 15:44, schrieb Roald de Vries:
Dear all,
I sometimes want to use an infinite while loop with access to the loop
index, like this:
def naturals():
i = 0
while True:
yield i
y += 1
for i in naturals():
print(i)
I assume a function like 'naturals' already exists, or a similar
constru
Dear all,
I sometimes want to use an infinite while loop with access to the loop
index, like this:
def naturals():
i = 0
while True:
yield i
y += 1
for i in naturals():
print(i)
I assume a function like 'naturals' already exists, or a similar
construction for the same