[issue32216] Document PEP 557 Data Classes
New submission from Eric V. Smith <eric@trueblade.com>: The documentation needs to be added. ---------- assignee: docs@python components: Documentation messages: 307614 nosy: docs@python, eric.smith priority: high severity: normal status: open title: Document PEP 557 Data Classes versions: Python 3.7 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Change by Ivan Levkivskyi <levkivskyi@gmail.com>: ---------- nosy: +levkivskyi _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Christopher Barker <Chris.Barker@noaa.gov> added the comment: 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. ---------- nosy: +Chris.Barker _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Change by Eric V. Smith <eric@trueblade.com>: ---------- title: Document PEP 557 Data Classes -> Document PEP 557 Data Classes (dataclasses module) _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
STINNER Victor <victor.stinner@gmail.com> added the comment: My Issue32406 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 ---------- nosy: +vstinner _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Barry A. Warsaw <barry@python.org> added the comment: Do you have an ETA for the documentation PR? I would be happy to review it. ---------- nosy: +barry _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Eric V. Smith <eric@trueblade.com> added the comment: 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. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Ned Deily <nad@python.org> added the comment: Marking this as a "deferred blocker" for exiting the beta phase. ---------- nosy: +ned.deily priority: high -> deferred blocker stage: -> needs patch versions: +Python 3.8 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Mariatta Wijaya <mariatta.wijaya@gmail.com> added the comment: I'd be interested to help write the PR for this. ---------- nosy: +Mariatta _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Raymond Hettinger <raymond.hettinger@gmail.com> added the comment:
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? ---------- nosy: +rhettinger _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Christopher Barker <Chris.Barker@noaa.gov> added the comment: Thanks Raymond. Can a draft be put in a gitHub repo so we can all help out? ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Mariatta Wijaya <mariatta.wijaya@gmail.com> added the comment:
I've already started on drafting these docs. Would you like to work together?
Sure, Raymond. Let me know how I can help :) ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Lino Mastrodomenico <l.mastrodomenico@gmail.com> added the comment: Friendly ping, there's still no documentation for this wonderful new module and there's only one planned beta left for 3.7 before the release candidates. Needless to say, https://www.python.org/dev/peps/pep-0557/ has lots of information that could be a starting point. ---------- nosy: +mastrodomenico _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Ned Deily <nad@python.org> added the comment: We really need to get this done prior to 370rc1 coming up on 05-21. ---------- priority: deferred blocker -> release blocker _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Eric V. Smith <eric@trueblade.com> added the comment: Note that the documentation should make the implications of #33453 very clear. In short, if an annotation "looks like" a ClassVar or InitVar, it will be treated as such. This is true even if it's specified as a string, or if it's a string due to "from __future__ import annotations". I'm planning on specifying more details in #33453. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Raymond Hettinger <raymond.hettinger@gmail.com> added the comment: Mariatta, go ahead and take the lead on this one. ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Change by Eric V. Smith <eric@trueblade.com>: ---------- keywords: +patch pull_requests: +6560 stage: needs patch -> patch review _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Eric V. Smith <eric@trueblade.com> added the comment: New changeset 98d50cb8f57eb227c373cb94b8680b12ec8aade5 by Eric V. Smith in branch 'master': bpo-32216: Add documentation for dataclasses (GH-6886) https://github.com/python/cpython/commit/98d50cb8f57eb227c373cb94b8680b12ec8... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +6566 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
miss-islington <mariatta.wijaya+miss-islington@gmail.com> added the comment: New changeset 04e96da5e4982afeb639d6a4d232c6c221fe3a9d by Miss Islington (bot) in branch '3.7': bpo-32216: Add documentation for dataclasses (GH-6886) https://github.com/python/cpython/commit/04e96da5e4982afeb639d6a4d232c6c221f... ---------- nosy: +miss-islington _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Eric V. Smith <eric@trueblade.com> added the comment: 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. ---------- assignee: docs@python -> eric.smith priority: release blocker -> resolution: -> fixed stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Barry A. Warsaw <barry@python.org> added the comment: 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. ---------- status: closed -> open _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Barry A. Warsaw <barry@python.org> added the comment: ...although I unfortunately cannot build it because of Issue33543 ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Change by Barry A. Warsaw <barry@python.org>: ---------- pull_requests: +6581 stage: resolved -> patch review _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Barry A. Warsaw <barry@python.org> added the comment: New changeset 713a9367366c88662c39ed20dd6bce22399299f1 by Barry Warsaw in branch 'master': bpo-32216: Update dataclasses documentation (#6913) https://github.com/python/cpython/commit/713a9367366c88662c39ed20dd6bce22399... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Change by miss-islington <mariatta.wijaya+miss-islington@gmail.com>: ---------- pull_requests: +6586 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Change by Barry A. Warsaw <barry@python.org>: ---------- stage: patch review -> resolved status: open -> closed _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
Barry A. Warsaw <barry@python.org> added the comment: New changeset 0c62e09774e445a185fd192524454ce697ca123b by Barry Warsaw (Miss Islington (bot)) in branch '3.7': bpo-32216: Update dataclasses documentation (GH-6913) (#6918) https://github.com/python/cpython/commit/0c62e09774e445a185fd192524454ce697c... ---------- _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue32216> _______________________________________
participants (10)
-
Barry A. Warsaw
-
Christopher Barker
-
Eric V. Smith
-
Ivan Levkivskyi
-
Lino Mastrodomenico
-
Mariatta Wijaya
-
miss-islington
-
Ned Deily
-
Raymond Hettinger
-
STINNER Victor