Well, it doesn't quite rule them all, but it is fast: About three times
faster than using one function per state. Faster than using generators.
Faster than using code objects.
Some, possibly minor, problems:
1. The generated code is ugly.
2. The generated code can be quite large, depending on
Carl Cerecke [EMAIL PROTECTED] writes:
3. Not as fast as byte code hacks, or using pyrex/psyco. Peter Hansen
is right. One of those is likely a better solution if you don't need
pure python.
If you don't need pure python than your approach still beats
everything else. Just generate C code (or
Paul Rubin wrote:
Carl Cerecke [EMAIL PROTECTED] writes:
3. Not as fast as byte code hacks, or using pyrex/psyco. Peter Hansen
is right. One of those is likely a better solution if you don't need
pure python.
If you don't need pure python than your approach still beats
everything else.