[Numpy-discussion] Porting strategy for py3k

David Cournapeau cournape at gmail.com
Thu Apr 23 10:52:24 EDT 2009


On Thu, Apr 23, 2009 at 11:20 PM, Pauli Virtanen <pav at iki.fi> wrote:
> Thu, 23 Apr 2009 22:38:21 +0900, David Cournapeau kirjoitti:
> [clip]
>>     I looked more in detail on what would be needed to port numpy to
>> py3k. In particular, I was interested at the possible strategies to keep
>> one single codebase for both python 2.x and python 3.x. The first step
>> is to remove all py3k warnings reported by python 2.6. A couple of
>> recurrent problems
>>     - reduce is removed in py3k
>>     - print is removed
>
> Print is not removed, just changed to a function. So,
>
>        print("foo")

Yes, as reduce, they are still available, but not as builtins anymore.
But replacing print is not as easy as reduce. Things like print
"yoyo", a do not work, for example.

> is valid code in 2.X and 3.0. OTOH, I don't think there are any valid use
> cases for "print" in Numpy code anyway (maybe apart from tests).

Yes, maybe. I will look at removing them completely.

>> Another problem is related to nose: there is an experimental branch for
>> nose which supports py3k, but nose <= 1.0 will not support py3k. The
>> nose author intend to support py3k in a version > 1.0, at which point he
>> will only support python 2.6 and above. I don't know what to do with
>> this (include our own nose in numpy for version < 2.6 - giving up
>> support for python < 2.6 does not sound like a realistic option in the
>> next few years).
>
> Can't we just assume Python 2.6 and 3.0 users have the appropriate
> versions of Nose installed? Or is the old Nose version going to disappear?

The problem is that nose 1.0 and py3k nose won't be compatible, and I
don't really know how much different they will be. It is still not
clear whether we will have to change our unit tests, for example.

David



More information about the NumPy-Discussion mailing list