Magic Optimisation

Terry Reedy tjreedy at udel.edu
Wed Sep 14 16:16:40 CEST 2005


"ABO" <abo at google.com> wrote in message 
news:1126696724.760484.311670 at g47g2000cwa.googlegroups.com...
> There are other "optimisations" that could be applied that make this
> code faster but uglier. For example, putting another "while True: loop
> inside the try block to avoid the try block setup each iteration.

In CPython, 'setting up' try-blocks is (intentionally) very fast, perhaps 
as fast or faster than one interation loop.

tjr






More information about the Python-list mailing list