<p><br>
On Jun 22, 2011 12:31 PM, "Neal Becker" <<a href="mailto:ndbecker2@gmail.com">ndbecker2@gmail.com</a>> wrote:<br>
><br>
> AFAICT, the python iterator concept only supports readable iterators, not write.<br>
> Is this true?<br>
><br>
> for example:<br>
><br>
> for e in sequence:<br>
>  do something that reads e<br>
>  e = blah # will do nothing<br>
><br>
> I believe this is not a limitation on the for loop, but a limitation on the<br>
> python iterator concept.  Is this correct?</p>
<p>consider the following code</p>
<p>x = [1,2,3]<br>
y = x[0]<br>
y = 5</p>
<p>Would you expect x to be [5,2,3] now? Assignment in python assigns a name to an object. It doesn't change the value of a variable. </p>
<p>If you have a generator, you can use send() to put data in you need the actual generator itself to do that.</p>
<p>><br>
> --<br>
> <a href="http://mail.python.org/mailman/listinfo/python-list">http://mail.python.org/mailman/listinfo/python-list</a></p>