Skip to content
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

support kw_only on dataclasses #3674

Merged
merged 4 commits into from Aug 8, 2022
Merged

Conversation

DetachHead
Copy link
Contributor

@DetachHead DetachHead commented Jan 14, 2022

Change Summary

Related issue number

fix #3670 (it's a discussion tho because the issue template didn't let me raise a feature request)

Checklist

  • Unit tests for the changes exist
  • Tests pass on CI and coverage remains at 100%
  • Documentation reflects the changes where applicable
  • changes/<pull request or issue id>-<github username>.md file added describing change
    (see changes/README.md for details)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

@DetachHead
Copy link
Contributor Author

please review

@DetachHead DetachHead changed the title support kw_only support kw_only on dataclasses Jan 14, 2022
@DetachHead
Copy link
Contributor Author

how do i make plugin-fail.txt expect a different output depending on the python version?

Copy link
Member

@samuelcolvin samuelcolvin left a comment

Choose a reason for hiding this comment

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

how do i make plugin-fail.txt expect a different output depending on the python version?

One solution (and it would make the overloads much cleaner below), is to always include kw_only in the type definition, then just raise a clear error for older versions?

Otherwise LGTM.

pydantic/dataclasses.py Outdated Show resolved Hide resolved
pydantic/dataclasses.py Outdated Show resolved Hide resolved
tests/test_dataclasses.py Outdated Show resolved Hide resolved
@samuelcolvin
Copy link
Member

please update.

@duducp
Copy link

duducp commented Apr 4, 2022

Is there any prediction for this feature?

@KotlinIsland
Copy link
Contributor

🔮

I predict that it will be... BASED!!!

@samuelcolvin
Copy link
Member

Should go into v1.10 which I'll start working on after we get v1.9.1 out.

@DetachHead DetachHead force-pushed the master branch 3 times, most recently from 77bbc81 to 7b02df4 Compare August 5, 2022 05:55
@DetachHead DetachHead force-pushed the master branch 2 times, most recently from dbdaa5f to 9e9018e Compare August 5, 2022 06:39
@samuelcolvin samuelcolvin merged commit 0b8b7eb into pydantic:master Aug 8, 2022
@samuelcolvin
Copy link
Member

Thanks so much.

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.

None yet

5 participants