[Python-3000] doctest portability

Guido van Rossum guido at python.org
Sun Jun 1 03:49:22 CEST 2008


2to3 lets you specify exactly which fixers to run with the -f command line flag.

I really don't like the idea of having Py3k code with doctests written
in a dialect of Py2k...

--Guido

On Sat, May 31, 2008 at 8:47 AM, Stefan Behnel <stefan_ml at behnel.de> wrote:
> Georg Brandl wrote:
>> Stefan Behnel schrieb:
>>> I know, I could use the lib2to3 package, but it a) is a one-way tool
>>> in the
>>> wrong direction if you have to distinguish bytes/str literals, b) lacks
>>> configurability stating exactly what changes need to be done and c)
>>> seemed
>>> harder to set up for doctests than doing the conversion by hand.
>>
>> Shouldn't the -d option handle doctests without further set-up?
>
> If you start 2to3 from the command prompt to convert the files that contain
> the doctests and copy them to a new location, then yes. But the question is:
> how do you run a Py2 doctest in Py3 without first copying your doctests or
> doctest containing sources to new files and then running the tests from there?
> You can't require people to put such a work-around into every test script in
> the world. Adding an option, fine. Copying files, adapting paths and all that,
> why?
>
> Stefan
>
> _______________________________________________
> Python-3000 mailing list
> Python-3000 at python.org
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe: http://mail.python.org/mailman/options/python-3000/guido%40python.org
>



-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)


More information about the Python-3000 mailing list