Message361953
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. |
|
Date |
User |
Action |
Args |
2020-02-13 12:10:14 | Andrew Wall | set | recipients:
+ Andrew Wall |
2020-02-13 12:10:14 | Andrew Wall | set | messageid: <1581595814.35.0.681093135233.issue39625@roundup.psfhosted.org> |
2020-02-13 12:10:14 | Andrew Wall | link | issue39625 messages |
2020-02-13 12:10:14 | Andrew Wall | create | |
|