This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: Add optimize argument to builtin compile() and byte-compilation modules
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.2
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: eric.araujo Nosy List: eric.araujo, georg.brandl, kristjan.jonsson, python-dev
Priority: normal Keywords: patch

Created on 2010-11-27 20:38 by georg.brandl, last changed 2022-04-11 14:57 by admin. This issue is now closed.

File name Uploaded Description Edit
compile-optimize.diff georg.brandl, 2010-11-27 20:38 patch version 1 review
Messages (7)
msg122552 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-11-27 20:38
This patch adds an "optimize" parameter to compile(), as discussed in <>.

I also needed to introduce two new C APIs.  Better naming suggestions are welcome.
msg122611 - (view) Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) Date: 2010-11-28 03:19
This looks fairly complete.
I spotted the word "optimze" in there :)
As for the C api, I always cringe when I add an "Ex" function myself, because it feels like I'm spending my last bullet.  What to do if I need yet another parameter later?  ExEx?
For that reason, I have started to use an options structure with a "size" argument at the start more often.  Ugly windows style.
But since these functions haven't changed much for a long time, there is perhaps no need to fret.

I didn't see an "optimize" option to PyZipFile, the original usecase this all sprung out of.
msg123328 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-12-04 10:26
Added PyZipFile API, and fixed the "optimze". Committed in r87019.
msg123380 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-12-04 17:55
As discussed on IRC, compileall had not gained a new command-line argument because “python -O -m compileall” does the job.  Can I make a doc update for that, or do you think it may be obvious enough?
msg123381 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-12-04 17:56
Yes, a doc update is probably a good idea.  (But after the freeze :)
msg123382 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-12-04 18:18
Temporarily reopening.
msg132211 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-03-26 02:23
New changeset 81c001680b36 by Éric Araujo in branch '3.2':
#10553: Explain why compileall has no command-line argument to control optimization

New changeset 125fbebbb5cd by Éric Araujo in branch 'default':
Merge #10553 followup from 3.2
Date User Action Args
2022-04-11 14:57:09adminsetgithub: 54762
2011-03-26 02:24:46eric.araujosetstatus: open -> closed
resolution: accepted -> fixed
stage: resolved
2011-03-26 02:23:57python-devsetnosy: + python-dev
messages: + msg132211
2010-12-04 18:18:02eric.araujosetstatus: closed -> open
assignee: eric.araujo
messages: + msg123382
2010-12-04 17:56:39georg.brandlsetmessages: + msg123381
2010-12-04 17:55:43eric.araujosetnosy: + eric.araujo
messages: + msg123380
2010-12-04 10:26:54georg.brandlsetstatus: open -> closed
resolution: accepted
messages: + msg123328
2010-11-28 03:19:10kristjan.jonssonsetmessages: + msg122611
2010-11-27 20:38:34georg.brandlcreate