[Python-Dev] Examples in Py2 or Py3

Facundo Batista facundobatista at gmail.com
Thu Jan 29 13:50:14 CET 2009


Hi!

In the Python Argentina mail list there's already people passing
examples and asking help about Python 3.

This introduces the problem that some examples are in Py2 and others
are in Py3. Sometimes this is not explicit, and gets confusing. I'm
trying to avoid this confusion when preparing my own examples. So far,
I use (py3) as a prefix for any example block, like:

(Py3k)
>>> (some example)
(some result)

Is there any recommended way to avoid confusion in these cases? (I'm
thinking about changing the prompt in my Python installation, to
something like ">2>>" and ">3>>", to be explicit about it... but I
wanted to know if there's another better way)

Thanks.

-- 
.    Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/


More information about the Python-Dev mailing list