If you write a function that happens to have a "yield" statement in it, the function becomes a generator, which behaves in a completely different way from a normal function.
(I don't have a problem with generators. Ruby's Enumerable, Scheme streams, all good. The problem is that you have a function that, without any change in how it's declared, changes from a function-you-call-and-get-something-back to a function-you-call-to-get-an-object-that-y
When you write a language feature like that, you're saying you don't give a damn about readability. For a language that sells itself on readability, that's FAIL FAIL FAIL SUPER FAIL. Go home, blog about what you did, and study Cobol for a year as penance.
$ python Python 2.5.1 (r251:54863, Jul 23 2008, 11:00:16) [GCC 4.0.1 (Apple Inc. build 5465)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> def function(): ... print "hello" ... >>> def generator(): ... print "hello" ... yield "goodbye" ... >>> function() hello >>> generator() <generator object="object" at="at" 0x6bbc0="0x6bbc0"> >>> generator().next() hello 'goodbye' >>>