[issue39625] Traceback needs more details
Andrew Wall
report at bugs.python.org
Thu Feb 13 07:10:14 EST 2020
New submission from Andrew Wall <quamrana at gmail.com>:
I encountered a question on Stackoverflow where, unusually, a Traceback was given in full, but I couldn't diagnose the problem.
It was like this:
Traceback (most recent call last):
File "soFailedTraceback.py", line 15, in <module>
c = C(C1("C1"), C2("C2"))
TypeError: __init__() missing 1 required positional argument: 'p'
What I am claiming is missing is info about class C1:
File "soFailedTraceback.py", line 8, in <module>
def __init__(self, s1, p):
Here is the file soFailedTraceback.py:
#soFailedTraceback
class C:
def __init__(self, c1, p):
pass
class C1:
def __init__(self, s1, p):
pass
class C2:
def __init__(self, s1):
pass
c = C(C1("C1"), C2("C2"))
I find the Traceback confusing, because it so happens there are two classes which have required positional argument "p", but python does not directly show which class it is.
----------
messages: 361953
nosy: Andrew Wall
priority: normal
severity: normal
status: open
title: Traceback needs more details
type: enhancement
versions: Python 3.8
_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39625>
_______________________________________
More information about the Python-bugs-list
mailing list