Skip to content

Document PEP 557 Data Classes (dataclasses module) #76397

Closed

Description

@ericvsmith
BPO 32216
Nosy @warsaw, @rhettinger, @vstinner, @ericvsmith, @ned-deily, @ilevkivskyi, @Mariatta, @miss-islington
PRs
  • bpo-32216: Add documentation for dataclasses #6886
  • [3.7] bpo-32216: Add documentation for dataclasses (GH-6886) #6894
  • bpo-32216: Update dataclasses documentation #6913
  • [3.7] bpo-32216: Update dataclasses documentation (GH-6913) #6918
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/ericvsmith'
    closed_at = <Date 2018-05-16.19:52:10.314>
    created_at = <Date 2017-12-05.02:05:11.093>
    labels = ['3.7', '3.8', 'docs']
    title = 'Document PEP 557 Data Classes (dataclasses module)'
    updated_at = <Date 2018-05-16.20:37:17.110>
    user = 'https://github.com/ericvsmith'

    bugs.python.org fields:

    activity = <Date 2018-05-16.20:37:17.110>
    actor = 'barry'
    assignee = 'eric.smith'
    closed = True
    closed_date = <Date 2018-05-16.19:52:10.314>
    closer = 'barry'
    components = ['Documentation']
    creation = <Date 2017-12-05.02:05:11.093>
    creator = 'eric.smith'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 32216
    keywords = ['patch']
    message_count = 21.0
    messages = ['307614', '308608', '308920', '311496', '311498', '311499', '311531', '311576', '311583', '311584', '314823', '316360', '316545', '316634', '316783', '316790', '316793', '316839', '316840', '316854', '316862']
    nosy_count = 11.0
    nosy_names = ['barry', 'rhettinger', 'vstinner', 'eric.smith', 'ned.deily', 'mastrodomenico', 'Chris.Barker', 'docs@python', 'levkivskyi', 'Mariatta', 'miss-islington']
    pr_nums = ['6886', '6894', '6913', '6918']
    priority = None
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue32216'
    versions = ['Python 3.7', 'Python 3.8']

    Activity

    1. ericvsmith commented on Dec 5, 2017

      @ericvsmith
      MemberAuthor

      The documentation needs to be added.

    2. added
      3.7 (EOL)
      docs
      on Dec 5, 2017
    3. ChrisBarker commented on Dec 19, 2017

      ChrisBarkermannequin
      Mannequin

      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:
      @dataclass
      class C:
          a: ...   # field without a default
          b: ... = 0 # field with a default

      or something like that.

      Then purposely introduce "how to add type hints" a bit down in the docs.

    4. changed the title [-]Document PEP 557 Data Classes[/-] [+]Document PEP 557 Data Classes (dataclasses module)[/+] on Dec 21, 2017
    5. vstinner commented on Dec 21, 2017

      @vstinner
      Member

      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

    6. warsaw commented on Feb 2, 2018

      @warsaw
      Member

      Do you have an ETA for the documentation PR? I would be happy to review it.

    7. ericvsmith commented on Feb 2, 2018

      @ericvsmith
      MemberAuthor

      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.

    8. ned-deily commented on Feb 2, 2018

      @ned-deily
      Member

      Marking this as a "deferred blocker" for exiting the beta phase.

    9. Mariatta commented on Feb 3, 2018

      @Mariatta
      Member

      I'd be interested to help write the PR for this.

    10. rhettinger commented on Feb 3, 2018

      @rhettinger
      Contributor

      I'd be interested to help write the PR for this.

      I've already started on drafting these docs. Would you like to work together?

    11. ChrisBarker commented on Feb 4, 2018

      ChrisBarkermannequin
      Mannequin

      Thanks Raymond. Can a draft be put in a gitHub repo so we can all help out?

    12. 6 remaining items

    13. rhettinger commented on May 15, 2018

      @rhettinger
      Contributor

      Mariatta, go ahead and take the lead on this one.

    14. ericvsmith commented on May 16, 2018

      @ericvsmith
      MemberAuthor

      New changeset 98d50cb by Eric V. Smith in branch 'master':
      bpo-32216: Add documentation for dataclasses (GH-6886)
      98d50cb

    15. miss-islington commented on May 16, 2018

      @miss-islington
      Contributor

      New changeset 04e96da by Miss Islington (bot) in branch '3.7':
      bpo-32216: Add documentation for dataclasses (GH-6886)
      04e96da

    16. ericvsmith commented on May 16, 2018

      @ericvsmith
      MemberAuthor

      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.

    17. warsaw commented on May 16, 2018

      @warsaw
      Member

      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.

    18. reopened this on May 16, 2018
    19. warsaw commented on May 16, 2018

      @warsaw
      Member

      ...although I unfortunately cannot build it because of bpo-33543

    20. warsaw commented on May 16, 2018

      @warsaw
      Member

      New changeset 713a936 by Barry Warsaw in branch 'master':
      bpo-32216: Update dataclasses documentation (bpo-6913)
      713a936

    21. warsaw commented on May 16, 2018

      @warsaw
      Member

      New changeset 0c62e09 by Barry Warsaw (Miss Islington (bot)) in branch '3.7':
      bpo-32216: Update dataclasses documentation (GH-6913) (bpo-6918)
      0c62e09

    22. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    3.7 (EOL)3.8 (EOL)docs

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions