-
-
Notifications
You must be signed in to change notification settings - Fork 33.9k
bpo-33129: Add kwarg-only option to dataclass #6238
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
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
|
So I guess there are two things to discuss: (1) How does this work with inheritance? In this PR, I chose to take the simplest route and say that if (2) What to call the flag? I choose |
|
Hello, and thanks for your contribution! I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA). Unfortunately our records indicate you have not signed the CLA. For legal reasons we need you to sign this before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue. Thanks again to your contribution and we look forward to looking at it! |
|
We'll need to discuss this on python-ideas first. But since 3.8 is 1.5+ years away, I don't think we'll take any actions on it until dataclasses have some real-world use. Maybe look at |
|
Closing as the CLA has not been signed within the last month. |
|
@brettcannon How can this be pushed forward? The author apparently has lost interest or didn't want to sign the CLA. If I want this feature to be added, do I need to try to unsee the code changes here and implement the exact same thing myself, hoping it's not too similar? |
|
I'm not sure it makes sense to move forward until we have a firm design. There are various proposals for making all params keyword only, some params keyword only (via Field), and various options with what to do when inheriting. I think working this out on python-ideas first, then recording the decisions in the bpo issue, then writing a patch is the correct order. I'd also like to do some research on what attrs does, if that's not already been done. I'm not sure if this rises to the level of needing a PEP, but there are a lot of issues to work through. |
|
@ericvsmith This was proposed 3 times in 2018 on python-ideas: https://mail.python.org/archives/list/python-ideas@python.org/message/YOK5DRIPJJ4TXIVI2F7VYJZ3LBE35DCG/ and it stopped at "OK, but we need to discuss the details and it won't be the upcoming release anyway". I have recently tried to revive the discussion on python-ideas, so far only receiving one reply with support, but I don't think that was from a core developer. attrs have I'm not saying this needs to be translated from attrs 1-to-1, but
I'm worried that the set of people who care about this feature is disjoint with the set of people who can conclude that the necessary discussion has reached a conclusion. I will reply to the original thread on python-ideas once more, pointing to the attrs solution. Could you please give it some thought, and some feedback, so that after a week (?) of no objections you could conclude that the discussion has reached a conclusion? |
|
PIng! has anything come of this? I think it'd be a great feature. |
Same here, great feature to be added! |
https://bugs.python.org/issue33129