Skip to content

Conversation

Tapeline
Copy link
Contributor

@Tapeline Tapeline commented Jul 7, 2025

Solved removing function name from error message entirely

@python-cla-bot
Copy link

python-cla-bot bot commented Jul 7, 2025

All commit authors signed the Contributor License Agreement.

CLA signed

@Tapeline Tapeline changed the title gh-12345: Fix inconsistent TypeError messages regarding invalid values after * and ** gh-136327: Fix inconsistent TypeError messages regarding invalid values after * and ** Jul 7, 2025
funcstr, Py_TYPE(args)->tp_name);
Py_DECREF(funcstr);
}
_PyErr_Format(tstate, PyExc_TypeError,
Copy link
Contributor

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.

Copy link
Contributor Author

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

Copy link
Member

@efimov-mikhail efimov-mikhail left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@sobolevn sobolevn left a 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 :)

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@Tapeline
Copy link
Contributor Author

@markshannon, could you please review this?

@Tapeline
Copy link
Contributor Author

Tapeline commented Aug 3, 2025

Hi, @hugovk, could you please take a look at the error message wording change, since you are an RM. Do you think it looks better now? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants