-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
gh-136327: Fix inconsistent TypeError messages regarding invalid values after * and ** #136395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
funcstr, Py_TYPE(args)->tp_name); | ||
Py_DECREF(funcstr); | ||
} | ||
_PyErr_Format(tstate, PyExc_TypeError, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not to use %T formatter here? IIUC it is preferable now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nikita's suggestions on removing the function name entirely were motivated by the fact that getting this name is not fast and does not add much value (in fact, none at all). I've looked into the %T specification, and it seems to do x2 of work we just got rid of, so I doubt that that would be a positive change. Anyway, we're waiting on Mark's review on that, maybe he has another opinion
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While we are at it :)
TypeError: Value after ** must be a mapping, \ | ||
not function |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TypeError: Value after ** must be a mapping, \ | |
not function | |
TypeError: Value after ** must be a mapping, not function |
Please, fix similar cases :)
Solved removing function name from error message entirely