Steven D'Aprano <st...@remove-this-cybersource.com.au> writes: > Okay, we get it. Parsing HTML 5 is a bitch. What's your point? I don't > see how a case statement would help you here: you're not dispatching on a > value, but running through a series of tests until one passes.
A case statement switch(x):... into a bunch of constant case labels would be able to use x as an index into a jump vector, and/or do an unrolled logarithmic (bisection-like) search through the tests, instead of a linear search. -- http://mail.python.org/mailman/listinfo/python-list