classification
Title: Show the qualified name when a call fails
Type: enhancement Stage: resolved
Components: Interpreter Core Versions: Python 3.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: Names in function call exception should have class names, if they're methods
View: 2786
Assigned To: Nosy List: martin.panter, refi64
Priority: normal Keywords: patch

Created on 2016-10-25 21:47 by refi64, last changed 2018-07-26 08:18 by berker.peksag. This issue is now closed.

Files
File name Uploaded Description Edit
0001-Make-failed-calls-to-methods-show-the-fully-qualifie.patch refi64, 2016-10-25 21:53
Messages (3)
msg279460 - (view) Author: Ryan Gonzalez (refi64) * Date: 2016-10-25 21:47
e.g. make this:


class X:
    def __init__(self): pass

X(1)


print something like this:


TypeError: X.__init__() takes 1 positional argument but 2 were given


instead of:


TypeError: __init__() takes 1 positional argument but 2 were given


I'm trying to see if I can create a patch right now, though it probably won't be ready until Thursday.
msg279461 - (view) Author: Ryan Gonzalez (refi64) * Date: 2016-10-25 21:53
HAHA, I lied. :D Attached is what I have so far.
msg279462 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2016-10-25 21:57
Perhaps you should merge your work with Issue 2786. With a very brief look, the patches seem to take a similar approach.
History
Date User Action Args
2018-07-26 08:18:18berker.peksagsetstatus: open -> closed
type: enhancement
stage: resolved
2016-10-25 21:57:41martin.pantersetnosy: + martin.panter
messages: + msg279462
resolution: duplicate

superseder: Names in function call exception should have class names, if they're methods
2016-10-25 21:53:20refi64setfiles: + 0001-Make-failed-calls-to-methods-show-the-fully-qualifie.patch
keywords: + patch
messages: + msg279461
2016-10-25 21:47:29refi64create