<br><br><div class="gmail_quote">On Sun, Apr 11, 2010 at 1:59 PM, Michele Simionato <span dir="ltr"><<a href="mailto:michele.simionato@gmail.com">michele.simionato@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

I do not want to write two documentations for a module working both in<br>
Python 2.X and Python 3.X.<br></blockquote><div><br></div><div>There are modules which work in both 2.x and 3.x but still behave differently. How will you handle those ?</div><div>IMHO the way as it is is correct</div><div>

 </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
To avoid that, I would need the ability to interpret doctests<br>
according to the used Python version.<br>
<br>
I mean something like that:<br>
<br>
"""<br>
Documentation of the module <mymodule><br>
-----------------------------------------------------------------<br>
<br>
If you are using Python 2.X you can check that<br>
<br>
  >>> <2.X code> # doctest: <some directive for 2.X><br>
  <2.X output><br>
<br>
whereas if you are using Python 2.X you can check that<br>
<br>
  >>> <3.X code> # doctest: <some directive for 3.X><br>
  <3.X output><br>
<br>
Is something like that possible? If not, what are the options?<br>
2to3 theoretically can converts the doctests, but in practice I have<br>
seen that the doctests for my decorator module needs some manual<br>
tweaking.<br>
<font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br>