Decorators that execute once rather than every import (was: codec and decorator hacks)
22 Aug
2014
22 Aug
'14
6:42 a.m.
On Wed, Aug 20, 2014 at 7:25 AM, Donald Stufft
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
3507
Age (days ago)
3507
Last active (days ago)
2 comments
3 participants
participants (3)
-
Gregory P. Smith
-
INADA Naoki
-
Steven D'Aprano