John Nagle <na...@animats.com> writes: > Python doesn't have a "switch" or "case" statement, and when > you need a state machine with many states, that makes for painful, > slow code. ... > There's a comment in the code that it would be useful > to run a few billion lines of HTML through an instrumented version > of the parser to decide in which order the IF statements should be > executed. You shouldn't have to do that.
In that particular program it would probably be better to change those if/elif/elif/else constructs to dictionary lookups. I see the program already does that for some large tables. -- http://mail.python.org/mailman/listinfo/python-list