[Python-ideas] Changes to the existing optimization levels

Antoine Pitrou solipsis at pitrou.net
Thu Sep 28 15:02:48 EDT 2017


On Thu, 28 Sep 2017 12:48:15 -0600
Diana Clarke
<diana.joan.clarke at gmail.com> wrote:
> 
>     2) Added a new command line option N that allows you to specify
> any number of individual optimization flags.
> 
>     For example:
> 
>         python -N nodebug -N noassert -N nodocstring

We could instead reuse the existing -X option, which allows for
free-form implementation-specific flags.

> I'm also not certain if the various compile signatures are even open
> for change (int optimize => PyObject *optimizations), or if that's a
> no-no.

You probably want to keep the existing signatures for compatibility:
- in C, add new APIs with the new convention
- in Python, add a new (optional) function argument for the new
  convention

Regards

Antoine.




More information about the Python-ideas mailing list