summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorNed Batchelder <ned@nedbatchelder.com>2020-05-08 11:39:57 (GMT)
committerGitHub <noreply@github.com>2020-05-08 11:39:57 (GMT)
commit2effef7453986bf43a6d921cd471a8bc0722c36a (patch)
tree24c9cd3c35dc14e5ab01bcdb0cfbe05c52124089 /Doc
parentd2c349b190bcba21a4a38e6520a48ad97a9f1529 (diff)
downloadcpython-2effef7453986bf43a6d921cd471a8bc0722c36a.zip
cpython-2effef7453986bf43a6d921cd471a8bc0722c36a.tar.gz
cpython-2effef7453986bf43a6d921cd471a8bc0722c36a.tar.bz2
Make the first dataclass example more useful (GH-19994)
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/dataclasses.rst2
1 files changed, 2 insertions, 0 deletions
diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst
index c125a11..fe63d20 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.'''