Fun with generators

Kay Schluehr kay.schluehr at gmx.net
Thu Nov 16 14:12:16 EST 2006


While this has been possible before and I guess ( from somewhat
superficial reading ) Michael Sparks Kamaelia project is all about this
kind of stuff, Python 2.5 generators can be used trivially to turn
higher order functions like reduce or map into generators producing
streams. After reading a thread here on comp.lang.python initiated by
someone who gets nervous about reduce() is going away in Py3K one might
just respond that it's not a big deal: functions are out anyway,
dataflow and coroutines are in :)

http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/498264




More information about the Python-list mailing list