You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Document PEP 557 Data Classes (dataclasses module) #76397
It was suggested that I could contirbute to the docs of dataclasses in this issue. Which confuses me, as there doesn't appear to be any content here to comment on. But what the heck:
As I've been annoyingly persistent about on the python-dev list, I think we need to be quite careful about making type hints appear to be a requirement for using dataclasses. In order to counter this, we could:
have the first couple example be type-less:
@dataclassclassC:
a: ... # field without a defaultb: ... =0# field with a default
or something like that.
Then purposely introduce "how to add type hints" a bit down in the docs.
I've added some initial documentation. Most of it is text from the PEP, cleaned up and sphinx-ized. It no doubt needs a lot of work, but I think it's good enough to close this issue and remove the release blocker. Changes to the documentation can be done going forward, including after 3.7.0rc1 is released.
Activity
ericvsmith commentedon Dec 5, 2017
The documentation needs to be added.
ChrisBarker commentedon Dec 19, 2017
It was suggested that I could contirbute to the docs of dataclasses in this issue. Which confuses me, as there doesn't appear to be any content here to comment on. But what the heck:
As I've been annoyingly persistent about on the python-dev list, I think we need to be quite careful about making type hints appear to be a requirement for using dataclasses. In order to counter this, we could:
or something like that.
Then purposely introduce "how to add type hints" a bit down in the docs.
[-]Document PEP 557 Data Classes[/-][+]Document PEP 557 Data Classes (dataclasses module)[/+]vstinner commentedon Dec 21, 2017
My bpo-32406 has been marked as a duplicate of this one. Copy of my message:
bpo-32214 "Implement PEP-557: Data Classes" added a new dataclasses module and was closed, but the new module is not documented:
https://docs.python.org/dev/library/dataclasses.html
And it's also missing from What's New in Python 3.7:
https://docs.python.org/dev/whatsnew/3.7.html
warsaw commentedon Feb 2, 2018
Do you have an ETA for the documentation PR? I would be happy to review it.
ericvsmith commentedon Feb 2, 2018
I was hoping a volunteer would step up to write the documentation, as it's definitely not my forte.
Raymond has also volunteered to help.
ned-deily commentedon Feb 2, 2018
Marking this as a "deferred blocker" for exiting the beta phase.
Mariatta commentedon Feb 3, 2018
I'd be interested to help write the PR for this.
rhettinger commentedon Feb 3, 2018
I've already started on drafting these docs. Would you like to work together?
ChrisBarker commentedon Feb 4, 2018
Thanks Raymond. Can a draft be put in a gitHub repo so we can all help out?
6 remaining items
rhettinger commentedon May 15, 2018
Mariatta, go ahead and take the lead on this one.
ericvsmith commentedon May 16, 2018
New changeset 98d50cb by Eric V. Smith in branch 'master':
bpo-32216: Add documentation for dataclasses (GH-6886)
98d50cb
miss-islington commentedon May 16, 2018
New changeset 04e96da by Miss Islington (bot) in branch '3.7':
bpo-32216: Add documentation for dataclasses (GH-6886)
04e96da
ericvsmith commentedon May 16, 2018
I've added some initial documentation. Most of it is text from the PEP, cleaned up and sphinx-ized. It no doubt needs a lot of work, but I think it's good enough to close this issue and remove the release blocker. Changes to the documentation can be done going forward, including after 3.7.0rc1 is released.
warsaw commentedon May 16, 2018
I've got a branch that cleans up and updates the dataclasses documentation, so I'm reopening this issue and piggybacking my PR on it.
warsaw commentedon May 16, 2018
...although I unfortunately cannot build it because of bpo-33543
warsaw commentedon May 16, 2018
New changeset 713a936 by Barry Warsaw in branch 'master':
bpo-32216: Update dataclasses documentation (bpo-6913)
713a936
warsaw commentedon May 16, 2018
New changeset 0c62e09 by Barry Warsaw (Miss Islington (bot)) in branch '3.7':
bpo-32216: Update dataclasses documentation (GH-6913) (bpo-6918)
0c62e09