Re: how to discover what values produced an exception?

Liste des GroupesRevenir à cl python 
Sujet : Re: how to discover what values produced an exception?
De : dieter.maurer (at) *nospam* online.de
Groupes : comp.lang.python
Date : 04. May 2024, 17:24:29
Autres entêtes
Message-ID : <mailman.5.1714841343.3326.python-list@python.org>
References : 1 2
User-Agent : VM 8.0.12-devo-585 under 21.4 (patch 24) "Standard C" XEmacs Lucid (x86_64-linux-gnu)
Johanne Fairchild wrote at 2024-5-3 10:56 -0300:
How to discover what values produced an exception?  Or perhaps---why
doesn't the Python traceback show the values involved in the TypeError?
For instance:
>
--8<-------------------------------------------------------->8---
(0,0) < 4
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
TypeError: '<' not supported between instances of 'tuple' and 'int'
--8<-------------------------------------------------------->8---
>
It could have said something like:
>
--8<-------------------------------------------------------->8---
TypeError: '<' not supported between instances of 'tuple' and 'int'
 in (0,0) < 4.
--8<-------------------------------------------------------->8---
>
We would know which were the values that caused the problem, which would
be very helpful.

Typically, the traceback informs you about the source code line
where the exception has been raised.
When the source line contains literals, you see the values.
If not, then only in special (speak: rather simple) cases the
knowledge of the values will help much.
Usually, a more thorough analysis is required to find out the bug
location and how to fix the bug.


Date Sujet#  Auteur
3 May 24 * how to discover what values produced an exception?12Johanne Fairchild
3 May 24 +* Re: how to discover what values produced an exception?4Stefan Ram
4 May 24 i`* Re: how to discover what values produced an exception?3Stefan Ram
4 May 24 i +- Re: how to discover what values produced an exception?1Stefan Ram
4 May 24 i `- Re: how to discover what values produced an exception?1Stefan Ram
3 May 24 +* Re: how to discover what values produced an exception?3Thomas Passin
4 May 24 i`* Re: how to discover what values produced an exception?2Alan Bawden
6 May 24 i `- Re: how to discover what values produced an exception?1Chris Angelico
4 May 24 +- Re: how to discover what values produced an exception?1dieter.maurer
4 May 24 +- Re: how to discover what values produced an exception?12QdxY4RzWzUUiLuE
4 May 24 +- Re: how to discover what values produced an exception?1Stefan Ram
3 May 24 `- Re: how to discover what values produced an exception?1Left Right

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal