doctests working both in Python 2.X and Python 3.X

M

Michele Simionato

I do not want to write two documentations for a module working both in
Python 2.X and Python 3.X.
To avoid that, I would need the ability to interpret doctests
according to the used Python version.

I mean something like that:

"""
Documentation of the module <mymodule>
-----------------------------------------------------------------

If you are using Python 2.X you can check that
<2.X output>

whereas if you are using Python 2.X you can check that
<3.X output>

Is something like that possible? If not, what are the options?
2to3 theoretically can converts the doctests, but in practice I have
seen that the doctests for my decorator module needs some manual
tweaking.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top