[Python-Dev] Created branch for PEP 302 phase 2 work (in C)

Neal Norwitz nnorwitz at gmail.com
Wed Oct 4 07:12:50 CEST 2006


On 10/2/06, Brett Cannon <brett at python.org> wrote:
>
> This is why I asked for input from people on which would take less time.
> Almost all the answers I got was that the the C code was delicate but that
> it was workable.  Several people said they wished for a Python
> implementation, but hardly anyone said flat-out, "don't waste your time, the
> Python version will be faster to do".

I didn't respond mostly because I pushed this direction to begin with.
 That and I'm lazy. :-)

There is a lot of string manipulation and some list manipulation that
is a royal pain in C and trivial in python.  Caching will be much
easier to experiement with in Python too.  The Python version will be
much smaller.  It will take far less time to code it in Python and
recode in C, than to try to get it right in C the first time.  If the
code is fast enough, there's no reason to rewrite in C.  It will
probably be easier to subclass a Python based version that a C based
version.

> As for the bootstrapping, I am sure it is resolvable as well.  There are
> several ways to go about it that are all tractable.

Right, I had bootstrapping with implementing xrange in Python, but it
was pretty easy to resolve in the end.  You might even want to use
part of that patch (from pythonrun.c?).  There was some re-org to make
bootstrapping easier/possible (I don't remember exactly right now).

n


More information about the Python-Dev mailing list