[Python-ideas] A Continuations Compromise in Python

George Sakkis george.sakkis at gmail.com
Sun May 3 16:46:00 CEST 2009


On Sun, May 3, 2009 at 3:02 AM, Steven D'Aprano <steve at pearwood.info> wrote:

> Just tossing a wild idea out there... is it conceivable to build a
> decorator that optimizes a tail-call recursive function?

Yes, check http://code.activestate.com/recipes/496691/. The caveat is
that for "small" values it actually pessimizes rather than optimizes
the function ("Note also that these decorators are not optimizing and
for small argument values they are actually far slower.")

George



More information about the Python-ideas mailing list