]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Make the first dataclass example more useful (GH-19994)
authorNed Batchelder <ned@nedbatchelder.com>
Fri, 8 May 2020 11:39:57 +0000 (07:39 -0400)
committerGitHub <noreply@github.com>
Fri, 8 May 2020 11:39:57 +0000 (04:39 -0700)
Doc/library/dataclasses.rst

index c125a1130a960361bcf47db14e62db5b9e109701..fe63d20671dd744fc3ac87b54b1d98754acceb9f 100644 (file)
@@ -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.'''