Deutsch   English   Français   Italiano  
<mailman.4.1714772954.3326.python-list@python.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!weretis.net!feeder8.news.weretis.net!fu-berlin.de!uni-berlin.de!not-for-mail
From: Thomas Passin <list1@tompassin.net>
Newsgroups: comp.lang.python
Subject: Re: how to discover what values produced an exception?
Date: Fri, 3 May 2024 17:39:46 -0400
Lines: 25
Message-ID: <mailman.4.1714772954.3326.python-list@python.org>
References: <8734qz9ey0.fsf@tudado.org>
 <918e3522-03e0-40e7-928d-bbf87698a7b3@tompassin.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de YImOBnBaBqRgxw/tQyFf8w6/nm94wbLZGjk+SGRB2Pww==
Cancel-Lock: sha1:JRmCS+Z1uROFZdJhsbsYfJd8KLI= sha256:Cc+evXWve8L7eLd9bwK/bn74obqxAmPCL9gX0BoFNQw=
Return-Path: <list1@tompassin.net>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
 reason="2048-bit key; unprotected key"
 header.d=tompassin.net header.i=@tompassin.net header.b=jhFl7Pte;
 dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.002
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'traceback': 0.04; '(most':
 0.05; 'last):': 0.05; 'enough.': 0.09; 'subject:how': 0.09;
 'typeerror:': 0.09; 'values.': 0.09; '9:56': 0.16; '>>>>': 0.16;
 'received:10.0.0': 0.16; 'received:64.90': 0.16;
 'received:64.90.62': 0.16; 'received:64.90.62.162': 0.16;
 'received:dreamhost.com': 0.16; 'subject:values': 0.16;
 'subject:what': 0.16; 'wrote:': 0.16; 'python': 0.16; 'values':
 0.17; 'to:addr:python-list': 0.20; 'problem,': 0.22; 'actual':
 0.25; 'header:User-Agent:1': 0.30; 'am,': 0.31; "doesn't": 0.32;
 '"",': 0.32; 'python-list': 0.32; 'received:10.0': 0.32;
 'received:mailchannels.net': 0.32;
 'received:relay.mailchannels.net': 0.32; 'header:In-Reply-To:1':
 0.34; 'trying': 0.35; 'file': 0.38; 'could': 0.38; 'something':
 0.40; 'involved': 0.63; 'types': 0.67; 'header:Received:6': 0.67;
 'received:64': 0.67; 'compare': 0.69; 'knowing': 0.71; 'discover':
 0.80; 'caused': 0.86
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
ARC-Seal: i=1; s=arc-2022; d=mailchannels.net; t=1714772387; a=rsa-sha256;
 cv=none;
 b=ZCGcU0vgHfkb8da7KDlGneKiqDt4wfyDnJSik/4U1eI7qeB5YCDjEOJx8tz0ufNB4TEqtJ
 UbMdUFDHaK//7qPFri/2NfuIl8trEqr42bycnhV//fzrN7Mf1go3kuzbVAxvrPkEomfhZb
 yAa9E+T9f5Q7iad/NZsYQ533GO2pPFpLP4H1mAkXfOzaYra+fV1pv6Q5yxHqlQxWH+h3xg
 HXC8EFxEhO9Mqw7/AtZUmdoBNVS4VGF2j7xpLkWsdJZdKWZYVbWfIqZzvEiV36vfiYShLs
 Vwz8VxWwzfflLAjkwjV8dfg3/kNK1V1ad/81YWx+7YXGrLmc2NwYjxSpD5jcCQ==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed;
 d=mailchannels.net; s=arc-2022; t=1714772387;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding:
 in-reply-to:in-reply-to:references:references:dkim-signature;
 bh=+7vlGHl78VGIIpkqQG6wNcd8GO0+wak2QZA2expfOVU=;
 b=tpU9tqotCoQfSgXoygUHqYBwDmRQDP4I0FtGImOsvZr0xXrtxu1W+91vRP85oHJue+G/IF
 2OEOb9BrfNjBaaVbjJMB2PiXmLfcYWQHinLCZFtKkKiA7IXLiuyx+ai32PkA7xaAX6kRWV
 z6u13HAT8WJXtBCy7SpNFRE8sJ0abX7ThE/EesNmOZllZl8sgEq7Ouz1RY+meZ9VGvb9ls
 nmi0p9P/YPTY6qFLEhmRkJexTIFWCX7HEAJsUUZWoqfbQsSAD6+s8YGVtMdCEzEWeBgfkb
 Ylx8N8nXM6+frpJQz0/KCwZcxuzfztsJxdiWX1TTUZb+oYP+hrPEOotl7OrsiA==
ARC-Authentication-Results: i=1; rspamd-5bcfdc8c55-5flws;
 auth=pass smtp.auth=dreamhost smtp.mailfrom=list1@tompassin.net
X-Sender-Id: dreamhost|x-authsender|tpassin@tompassin.net
X-MC-Relay: Neutral
X-MailChannels-SenderId: dreamhost|x-authsender|tpassin@tompassin.net
X-MailChannels-Auth-Id: dreamhost
X-Tangy-Broad: 06c01fa16ea7d210_1714772387993_935053137
X-MC-Loop-Signature: 1714772387993:2554773767
X-MC-Ingress-Time: 1714772387992
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tompassin.net;
 s=dreamhost; t=1714772387;
 bh=+7vlGHl78VGIIpkqQG6wNcd8GO0+wak2QZA2expfOVU=;
 h=Date:From:Subject:To:Content-Type:Content-Transfer-Encoding;
 b=jhFl7Pte4nq3micrEVRVEaZONB1srs+WXfrgIWRbow9kGsYJYSIxC2+Pko4YgzWFE
 /gcesmysuKtTqclvefJb+lktTpxT4N40z7FiPgBJha3KY5hVmuPJTFTCrpzjigGTQ3
 O12P+kazaE8ZOV6zkA4Ub3KoV/C3+Hu8e9HIObpCthtf2RghCo0weyf1YSUXUcjAb7
 LpQm6Ug+y9JEgrqq6yz7NEdxxAa7F7EGSKlVybQEe4E9+H30p6LFrmuDxwvUUEVSme
 9ESdNOFSYWlqHTaik9Mi9kIkLpagLd+ayYgO78kWlq9/Q5SN54yS5Tw5H28x7/ElEQ
 UywwELw8xJTWA==
User-Agent: Mozilla Thunderbird
Content-Language: en-US
In-Reply-To: <8734qz9ey0.fsf@tudado.org>
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
 <python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
 <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
 <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <918e3522-03e0-40e7-928d-bbf87698a7b3@tompassin.net>
X-Mailman-Original-References: <8734qz9ey0.fsf@tudado.org>
Bytes: 6296

On 5/3/2024 9:56 AM, Johanne Fairchild via Python-list wrote:
> 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.

In this example it would not help at all to know the actual values. 
Knowing that you are trying to compare incomparable types is enough.