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
Named tuple's _replace() method should raise TypeError for unexpected keyword arguments #110275
Comments
Let's leave these APIs alone. They are old, stable, and have never caused an issue for real users. |
…invalid arguments
Well, then I'll only change |
I wish you would just make the new code consistent with the existing replace implementations. Aim for the least invasive and least disruptive way to add your new function. But if you're going to persist forcing through a |
What do you think about other changes that I took the opportunity to do in
They are less important, so I do not persist. |
… invalid arguments (pythonGH-110299)
Bug report
When you call a function with incorrect key arguments, you get a TypeError. But it is not always so with the
_replace()
method of a named tuple class created bycollections.namedtuple()
.It is not even consistent with constructor which raises TypeError:
I think that
_replace()
also should raise TypeError for unexpected keyword arguments.cc @rhettinger
Linked PRs
The text was updated successfully, but these errors were encountered: