A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-April/063783.html below:

[Python-Dev] [Python-checkins] r45321 - in python/trunk: Lib/test/test_traceback.py Lib/traceback.py Misc/NEWS

[Python-Dev] [Python-checkins] r45321 - in python/trunk: Lib/test/test_traceback.py Lib/traceback.py Misc/NEWS [Python-Dev] [Python-checkins] r45321 - in python/trunk: Lib/test/test_traceback.py Lib/traceback.py Misc/NEWSGuido van Rossum guido at python.org
Sun Apr 16 15:33:45 CEST 2006
On 4/16/06, Paul Moore <p.f.moore at gmail.com> 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/)
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4