15.04.2013 Views

Core Python Programming (2nd Edition)

Core Python Programming (2nd Edition)

Core Python Programming (2nd Edition)

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

count.next()<br />

5<br />

>>> count.next()<br />

6<br />

>>> count.send(9)<br />

9<br />

>>> count.next()<br />

10<br />

>>> count.close()<br />

>>> count.next()<br />

Traceback (most recent call last):<br />

File "", line 1, in <br />

StopIteration<br />

You can read more about generators in PEPs 255 and 342, as well as in this Linux Journal article<br />

introducing readers to the new features in <strong>Python</strong> 2.2:<br />

http://www.linuxjournal.com/article/5597

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!