Skip to content

gh-110273: dataclasses.replace() now raise TypeError for all invalid arguments #110274

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

Conversation

serhiy-storchaka
Copy link
Member

@serhiy-storchaka serhiy-storchaka commented Oct 3, 2023

dataclasses.replace() now raises TypeError instead of ValueError if specify keyword argument for a field declared with init=False or miss keyword argument for required InitVar field.

…valid arguments

dataclasses.replace() now raises TypeError instead of ValueError if
specify keyword argument for a field declared with init=False or miss keyword
argument for required InitVar field.
Copy link
Member

@ericvsmith ericvsmith left a comment

Choose a reason for hiding this comment

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

This looks good to me.

@serhiy-storchaka serhiy-storchaka merged commit 5b9a3fd into python:main Oct 4, 2023
@serhiy-storchaka serhiy-storchaka deleted the dataclasses-replace-invalid-keyword branch October 4, 2023 06:20
@AdamWill AdamWill mentioned this pull request Jun 17, 2024
2 tasks
Glyphack pushed a commit to Glyphack/cpython that referenced this pull request Sep 2, 2024
…valid arguments (pythonGH-110274)

dataclasses.replace() now raises TypeError instead of ValueError if
specify keyword argument for a field declared with init=False or miss keyword
argument for required InitVar field.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants