[Numpy-discussion] Porting strategy for py3k

David Cournapeau david@ar.media.kyoto-u.ac...
Thu Apr 23 23:19:06 CDT 2009


Robert Kern wrote:
>
> Doesn't the 2to3 tool do this conversion for you?
>   

I have not seen it handling everything. It does not handle reduce, for
example:

print reduce(lambda x, y: x+y, [1, 2, 3])

is translated to

print(reduce(lambda x, y: x + y, [1, 1, 1]))

I guess an alternative to a compat module would be to extend 2to3, or
maybe mixing the two approaches. My understanding is that 2to3 is
"optimized" to get a single codebase for python 2.6 and 3.x, but we want
to be compatible below (>=2.4).

David





More information about the Numpy-discussion mailing list