type-generator

COMMENT: This is a bit inaccurate. Generator functions are implemented as ordinary function objects, which returns generator objects when called.

Generator functions

A function or method which uses the yield statement is called a generator function. Such a function, when called, always returns an iterator object which can be used to execute the body of the function: calling the iterator’s next method will cause the function to execute until it provides a value using the yield statement. When the function executes a return statement or falls off the end, a StopIteration exception is raised and the iterator will have reached the end of the set of values to be returned.

 

A Django site. this page was rendered by a django application in 0.07s 2008-11-21 06:27:38.263533. hosted by webfaction.