[Python-ideas] Decorators that execute once rather than every import (was: codec and decorator hacks)
Gregory P. Smith
greg at krypto.org
Fri Aug 22 08:42:59 CEST 2014
On Wed, Aug 20, 2014 at 7:25 AM, Donald Stufft <donald at stufft.io> wrote:
>
> mypy does have a codec that will ignore annotations on 2.x.
>
Note that all codec hacks and decorator hacks have a down side other than
being hacks: They significantly slow down program import and start time. At
least the results of the codec hack are cached when a .pyc is generated.
Decorator executions are not.
hmm.. could a flavor of decorator that is cacheable in .pyc's be created so
the cost is only paid once rather than for each time the module is imported?
-gps
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140821/069f5c51/attachment.html>
More information about the Python-ideas
mailing list