lanx@nc10-ubuntu:~$ python Python 2.5.2 (r252:60911, Jan 20 2010, 23:16:55) [GCC 4.3.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> def rubyyielder(gen): ... def wrapped_gen(block): ... for elem in gen(): ... block(elem) ... return wrapped_gen ... >>> @rubyyielder ... def test(): ... print("In test") ... yield 1 ... print("back in test") ... yield 2 ... >>> test(lambda a: print("You are in block %s" % a)) File "", line 1 test(lambda a: print("You are in block %s" % a)) ^ SyntaxError: invalid syntax