This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ammar2
Recipients Andrew Wall, ammar2, sdcards, vstinner
Date 2020-02-16.08:31:53
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1581841913.21.0.759013623858.issue39625@roundup.psfhosted.org>
In-reply-to
Content
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.
History
Date User Action Args
2020-02-16 08:31:53ammar2setrecipients: + ammar2, vstinner, Andrew Wall, sdcards
2020-02-16 08:31:53ammar2setmessageid: <1581841913.21.0.759013623858.issue39625@roundup.psfhosted.org>
2020-02-16 08:31:53ammar2linkissue39625 messages
2020-02-16 08:31:53ammar2create