On Sun, Apr 11, 2010 at 1:59 PM, Michele Simionato < michele.simion...@gmail.com> wrote:
> I do not want to write two documentations for a module working both in > Python 2.X and Python 3.X. > There are modules which work in both 2.x and 3.x but still behave differently. How will you handle those ? IMHO the way as it is is correct > 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 code> # doctest: <some directive for 2.X> > <2.X output> > > whereas if you are using Python 2.X you can check that > > >>> <3.X code> # doctest: <some directive for 3.X> > <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. > -- > http://mail.python.org/mailman/listinfo/python-list >
-- http://mail.python.org/mailman/listinfo/python-list