新的特性

Support for generators has been
added via the yield keyword. Generators provide an easy
way to implement simple iterators without the overhead or complexity of
implementing a class that implements the Iterator
interface.

A simple example that reimplements the range()
function as a generator (at least for positive step
values):