[Biopython-dev] 2to3 and doctests

Peter biopython at maubp.freeserve.co.uk
Fri Jul 16 15:58:03 UTC 2010


2010/7/16 Tiago Antão <tiagoantao at gmail.com>:
>
> 2010/7/16 Peter <biopython at maubp.freeserve.co.uk>:
>
>> Maybe we should file an enhancement bug report?
>
> Good idea, I will do that.
>
>> I like that plan except for a "bug" in 2to3, it will turn this example which
>> works for BOTH python 2 and python 3:
>>
>> print("Hello world")
>>
>> into this:
>>
>> print(("Hello world"))
>
> Well, as I see it, setup.py will never need to be converted by 2to3.
> Its is possible to do a single file that works in all versions,
> therefore that problem does not apply (unless people try to convert it
> explicitly - I think we need to recommend against that). This seems to
> be the case with numpy setup.py.
>
> My view is this:
> Current case:
> person calls setup.py, always works. In the p3 case just prints the
> warning and 2to3 recommendation.
> Future (stable):
> person calls setup.py , and it does everything necessary (calling 2to3
> if needed)
> Never:
> Person calls 2to3
> person calls setup.py
>
> In fact it does not make much sense as it is now: the person has to
> call 2to3 against setup.py in order to be informed to... call 2to3 ;)
> See my point?

I agree that we should tweak setup.py to run under both Python 2
(life as normal) and Python 3 (tells you to manually run 2to3 on the
source code etc, but then continues as normal).

We'll need to tweak input vs raw_input (Python 3 vs Python 2).

Peter




More information about the Biopython-dev mailing list