This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author tebeka
Recipients tebeka
Date 2009-05-21.20:34:15
SpamBayes Score 1.6844717e-05
Marked as misclassified No
Message-id <1242938060.5.0.00936464962761.issue6080@psf.upfronthosting.co.za>
In-reply-to
Content
Some (most?) of the itertools functions "generators" do not supprt "send".

>>> from itertools import count
>>> n = count(0)
>>> n.next()
0
>>> n.send(1)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'itertools.count' object has no attribute 'send'
>>> 

However:
>>> def count(start):
...     while 1:
...         yield start
...         start += 1
... 
>>> n = count(0)
>>> n.next()
0
>>> n.send(1)
1
>>> 

For some of the functions (such as count and repeat), "send" also make
sense.
History
Date User Action Args
2009-05-21 20:34:20tebekasetrecipients: + tebeka
2009-05-21 20:34:20tebekasetmessageid: <1242938060.5.0.00936464962761.issue6080@psf.upfronthosting.co.za>
2009-05-21 20:34:18tebekalinkissue6080 messages
2009-05-21 20:34:17tebekacreate