On 4/16/06, Paul Moore <[EMAIL PROTECTED]> wrote:
> Personally, my instinct is that having the whole traceback in a
> doctest is at least as ugly.

Well, it depends on what you use doctest for. If you use it to write
unit tests, the try/except solution is fine, and perhaps preferable.

If you use it as *documentation*, where doctest is used to ensure that
the documentation is accurate, showing a (short) traceback seems to be
the logical thing to do. In a sample session where you want to show
that a certain exception is raised for a certain combination of
erroneous arguments (for example), showing the traceback is much more
natural than putting a try/except around the erroneous call.

So one person's ugly is another person's pretty.

--
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to