Skip to content

Conversation

@sobolevn
Copy link
Member

@sobolevn sobolevn commented Aug 29, 2022

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.

@da-woods
Copy link
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.

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 is all great. Thanks! With the one nit about a comment, I'll accept this.

@bedevere-bot
Copy link

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
Copy link
Member Author

sobolevn commented Oct 3, 2022

Done!

I have made the requested changes; please review again.

@bedevere-bot
Copy link

Thanks for making the requested changes!

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

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.

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).


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
Member

Choose a reason for hiding this comment

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

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


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
Member

Choose a reason for hiding this comment

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

Same thing here with a trailing space.

@bedevere-bot
Copy link

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 ericvsmith merged commit 4f380db into python:main Oct 4, 2022
@sobolevn
Copy link
Member Author

sobolevn commented Oct 4, 2022

Thanks everyone!

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