Librenix  
(Show all Python articles . . .
)  
Headlines | Linux | Apps | Coding | BSD | Admin | News
Information for Linux System Administration 

Charming Python: Generator based state machines

Up
vote
Down

This article shows how to use Python's new generators to simplify state machines and simulate coroutines. It also shows additional patterns for the use of generators, in hopes of bringing readers further into the mindset of "resumable functions." If generators are new to you, you should first review the introduction to simple generators. There are a lot of benefits to using simple generators. In addition to offering more natural ways of expressing the flow of a class of problems, generators can dramatically improve many inefficiencies.
 read more | mail this link | score:6858 | -Debinay, July 19, 2002 (Updated: November 16, 2003)
More Programming articles...

Abstract Art Online Gallery

coding headlines

No Starch Press has published my Perl One-Liners book!

 

Firefox sidebar

Site map

Site info

News feed

Features

Login
(to post)

Search

 
Articles are owned by their authors.   © 2000-2012 Ray Yeargin