[Python-Dev] AST optimizer implemented in Python
Eric Snow
ericsnowcurrently at gmail.com
Sun Aug 12 01:02:43 CEST 2012
On Sat, Aug 11, 2012 at 3:27 PM, "Martin v. Löwis" <martin at v.loewis.de> wrote:
> I think you misunderstood. What gps is concerned about (IIUC) that some
> people add ast optimizers in some run of Python, but other AST optimizers in
> a different run. Then, if you use a Python byte code
> file, you should be able to find out what AST optimizers have been
> run to create the pyc file, so you know whether you have to recompile
> or not.
>
> Of course, if that is really a desirable feature, you may want multiple
> pyc files, per combination of AST optimizers. The __pycache__ directory
> would readily support that.
Perhaps it's a bit of an abuse, but modifying
sys.implementation.cache_tag should result in separate .pyc file in
__pycache__. Using the same cache tag later would mean that .pyc file
gets loaded during import.
-eric
More information about the Python-Dev
mailing list