Message362052
I don't know how common this situation is, the fact that all constructors go to __init__ here makes it a little tough in this case but normally you'd be able to tell by the function name.
One potential solution might be to show which file the error came from like this:
Traceback (most recent call last):
File "D:\x.py", line 13, in <module>
c = C(C1("C1"), C2("C2"))
TypeError: [D:\x.py:6] __init__() missing 1 required positional argument: 'p'
This is a pretty trivial change in ceval.c:3779 but might make the errors pretty long unless (especially now that co_filename is an absolute path) we chop them off to just the name of the file.
Including the frame information for the function about to be called would be much more difficult.
Overall this situation might not be worth improving because it's so rare but having the function location in the error might be worth having just as an extra information point. |
|
Date |
User |
Action |
Args |
2020-02-16 08:31:53 | ammar2 | set | recipients:
+ ammar2, vstinner, Andrew Wall, sdcards |
2020-02-16 08:31:53 | ammar2 | set | messageid: <1581841913.21.0.759013623858.issue39625@roundup.psfhosted.org> |
2020-02-16 08:31:53 | ammar2 | link | issue39625 messages |
2020-02-16 08:31:53 | ammar2 | create | |
|