| Deutsch English Français Italiano |
|
<exceptions-20240504211223@ram.dialup.fu-berlin.de> View for Bookmarking (what is this?) Look up another Usenet article |
Path: ...!fu-berlin.de!uni-berlin.de!not-for-mail
From: ram@zedat.fu-berlin.de (Stefan Ram)
Newsgroups: comp.lang.python
Subject: Re: how to discover what values produced an exception?
Date: 4 May 2024 20:13:23 GMT
Organization: Stefan Ram
Lines: 14
Expires: 1 Feb 2025 11:59:58 GMT
Message-ID: <exceptions-20240504211223@ram.dialup.fu-berlin.de>
References: <8734qz9ey0.fsf@tudado.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Trace: news.uni-berlin.de kx95te4tPdlxA7z/vtthqAAXilNYcelOrhnDYN9fRdH4XH
Cancel-Lock: sha1:dswNWVslEFCS+Mc0CRZpSnlr0qg= sha256:6RgQPy18hnRxCk1n+8XShwbC7GV78s1nGZhAJQFFBrI=
X-Copyright: (C) Copyright 2024 Stefan Ram. All rights reserved.
Distribution through any means other than regular usenet
channels is forbidden. It is forbidden to publish this
article in the Web, to change URIs of this article into links,
and to transfer the body without this notice, but quotations
of parts in other Usenet posts are allowed.
X-No-Archive: Yes
Archive: no
X-No-Archive-Readme: "X-No-Archive" is set, because this prevents some
services to mirror the article in the web. But the article may
be kept on a Usenet archive server with only NNTP access.
X-No-Html: yes
Content-Language: en-US
Bytes: 2046
Johanne Fairchild <jfairchild@tudado.org> wrote or quoted:
>We would know which were the values that caused the problem, which would
>be very helpful.
So, why don't critical values get automatically printed out when
exceptions happen?
In Python, printing out a value usually means calling a method
like "__str__" or "__repr__". But the thing is, the exception
could have been raised inside that very method. If you then try
to automatically print out a critical value, that could trigger
more exceptions or other issues. Basically, you could end up
activating all sorts of random code, and the consequences of
that in that kind of situation are hard to predict