[Python-checkins] Make the first dataclass example more useful (GH-19994) (GH-19997)
Miss Islington (bot)
webhook-mailer at python.org
Fri May 8 07:52:20 EDT 2020
https://github.com/python/cpython/commit/546f643487f5116b795983c951141e0de78a0049
commit: 546f643487f5116b795983c951141e0de78a0049
branch: 3.8
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2020-05-08T07:52:10-04:00
summary:
Make the first dataclass example more useful (GH-19994) (GH-19997)
(cherry picked from commit 2effef7453986bf43a6d921cd471a8bc0722c36a)
Co-authored-by: Ned Batchelder <ned at nedbatchelder.com>
Co-authored-by: Ned Batchelder <ned at nedbatchelder.com>
files:
M Doc/library/dataclasses.rst
diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst
index 37258d4ebc738..10edcac7e8a9b 100644
--- a/Doc/library/dataclasses.rst
+++ b/Doc/library/dataclasses.rst
@@ -19,6 +19,8 @@ in :pep:`557`.
The member variables to use in these generated methods are defined
using :pep:`526` type annotations. For example this code::
+ from dataclasses import dataclass
+
@dataclass
class InventoryItem:
'''Class for keeping track of an item in inventory.'''
More information about the Python-checkins
mailing list