Johanne Fairchild
2024-05-03 13:56:39 UTC
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---
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.
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.