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:6545 | -Debinay, July 19, 2002 (Updated: November 16, 2003)
More Programming articles...

Buy Large Wall Art Prints

coding headlines

OpenShift Online: a non-developer guide

Detailed Error Handling In Bash

Develop your own Raspberry Pi OS

Unix: Shell Script Wrapper Examples

Introduction to Perl one-liners

Using Git for Source Control

 

Firefox sidebar

Site map

Site info

News feed

Features

Login
(to post)

Search

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