FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-96142: add missing params to `dataclass._DataclassParams` by sobolevn · Pull Request #96382 · python/cpython · GitHub

Repository navigation

gh-96142: add missing params to dataclass._DataclassParams - #96382

Merged
ericvsmith merged 5 commits into
python:mainfrom
sobolevn:issue-96142
Oct 4, 2022
Merged

ericvsmith merged 5 commits into
python:mainfrom
sobolevn:issue-96142

Conversation

sobolevn commented Aug 29, 2022 •
edited
Loading

Copy link
Copy Markdown
Member

I went with explicit .__dataclass_params__ attribute access instead of getattr(klass, _PARAMS) because it felt more safe and concete to me.

I've also considered kw_only argument by @da-woods, but it feels like _DataclassParams structure must just hold passed arguments without much logic in it. It is up to the caller to inspect kw_only on class/field.

Copy link
Copy Markdown
Contributor

I've also considered kw_only argument by @da-woods, but it feels like _DataclassParams structure must just hold passed arguments without much logic in it. It is up to the caller to inspect kw_only on class/field.

I think "include all the parameters" is a pretty defensible position too.

ericvsmith left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This is all great. Thanks! With the one nit about a comment, I'll accept this.

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

And if you don't make the requested changes, you will be poked with soft cushions!

sobolevn commented Oct 3, 2022

Copy link
Copy Markdown
Member Author

Done!

I have made the requested changes; please review again.

Copy link
Copy Markdown

Thanks for making the requested changes!

@ericvsmith: please review the changes made to this pull request.

ericvsmith left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

There are some trailing spaces that are causing CI failures. I haven't actually checked every line for trailing whitespace, just the ones I quickly found (I'm working on checking out the code, but you can probably check faster than my connection can clone the code).

Comment thread Lib/test/test_dataclasses.py Outdated

def test_dataclass_params_repr(self):
# Even though this is testing an internal implementation detail,
# it's testing a feature we want to make sure is correctly implemented

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

There's a trailing space on this line that is causing a CI failure.

Comment thread Lib/test/test_dataclasses.py Outdated

def test_dataclass_params_signature(self):
# Even though this is testing an internal implementation detail,
# it's testing a feature we want to make sure is correctly implemented

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Same thing here with a trailing space.

Copy link
Copy Markdown

A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated.

Once you have made the requested changes, please leave a comment on this pull request containing the phrase I have made the requested changes; please review again. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

ericvsmith merged commit 4f380db into python:main Oct 4, 2022

sobolevn commented Oct 4, 2022

Copy link
Copy Markdown
Member Author

Thanks everyone!

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

5 participants


Back | FazBrowse Home | New Git URL