Fun with generators

K

Kay Schluehr

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top