[Python-3000] No (C) optimization flag

Guido van Rossum guido at python.org
Fri Aug 10 21:19:48 CEST 2007


On 8/10/07, Neil Schemenauer <nas at arctrix.com> wrote:
> Nick Coghlan <ncoghlan at gmail.com> wrote:
> > However we select between Python and native module versions, the build
> > bots need be set up to run the modules both ways (with and without C
> > optimisation).
>
> If there is a way to explictly import each module separately then I
> think that meets both needs.

This sounds good. It may be as simple as moving the Python
implementation into a separate module as well, and having the public
module attempt to import first from the C code, then from the Python
code.

I think that if there's code for which no C equivalent exists (e.g.
some stuff in heapq.py, presumably some stuff in io.py), it should be
in the public module, so the latter cal do something like this:

try:
  from _c_foo import *  # C version
except ImportError:
  from _py_foo import *  # Py vesrion

-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list