[Numpy-discussion] 2to3c: 2to3 for C extensions

René Dudfield renesd at gmail.com
Sun Nov 22 13:51:22 EST 2009


On Sun, Nov 22, 2009 at 7:28 PM, René Dudfield <renesd at gmail.com> wrote:
> On Sun, Nov 22, 2009 at 7:16 PM, Pauli Virtanen <pav at iki.fi> wrote:
>> la, 2009-11-21 kello 20:00 -0500, David Warde-Farley kirjoitti:
>>> Guido posted a link to this on Twitter, it might be of interest to
>>> people interested in the NumPy Python 3 transition:
>>>
>>>       http://dmalcolm.livejournal.com/3935.html
>>>
>>> It's doubtful this is a magic bullet (at least, not yet) but it may
>>> still help reduce the amount of busywork involved.
>>
>> Interesting -- though at the moment it doesn't seem to solve very many
>> of our problems.
>>
>>
>> I did some cleanup of numpy.testing, distutils, and core so that using
>> 2to3 the build_ext in numpy.core can at least be started:
>>
>>        http://github.com/pv/numpy-work/tree/py3k
>>
>>        python3 tools/py3test testing distutils core
>>
>> Of course, the build currently fails with zillion errors in
>> multiarraymodule.
>>
>>        Pauli
>>
>
> hi,
>
> I've been working on this too... see the previous py3k thread for
> details of my plan.  See http://github.com/illume/numpy3k/tree/work
> for my (not very much) progress.
>
> I don't have time for about a week to do any more work on my tree.
> Maybe your tree is ahead anyway... I am taking the approach we used
> with pygame so that the tree can work with both python 2.x and 3.x.  I
> got up to getting a fair amount of the setup code working... but there
> are still some issues.
>
> The 2to3 script for C code does look useful.  However it will not work
> in a backwards compatible manner.  However maybe it can be modified to
> work in such a way.
>

hi again,

I was wrong about it not generating 2 and 3 compatible source... the
tool does do things like this:

#if PY_MAJOR_VERSION >= 3
  foo();
#else
  bar();
#endif


Very cool!!!


cheers,



More information about the NumPy-Discussion mailing list