By cjsmith
via css.dzone.com
Published: Feb 03 2012 / 09:40
Another mock recipe, this one for mocking generator methods. A Python generator is a function or method that uses the yield statement to return a series of values when iterated over (there are also generator expressions and more advanced uses of generators, but we aren't concerned about them here. A very good introduction to generators and how powerful they are is: Generator Tricks for Systems Programmers.).



Add your comment