[Tutor] iretator.send

Christopher King g.nius.ck at gmail.com
Tue Sep 20 00:55:19 CEST 2011


Dear tutor dudes,
    I know that a for loop uses a an iterators next method in this way

for variable in iterator:
    execute_code(variable)

is equivalent to

while True:
    try:
        variable = iterator.next()
    except StopIteration:
        break
    else:
        execute_code(variable)

Is there any syntax that uses the send method of an iterator?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20110919/568727e0/attachment.html>


More information about the Tutor mailing list