]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Make the first dataclass example more useful (GH-19994) (GH-19997) 20004/head
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Fri, 8 May 2020 11:52:10 +0000 (04:52 -0700)
committerGitHub <noreply@github.com>
Fri, 8 May 2020 11:52:10 +0000 (07:52 -0400)
(cherry picked from commit 2effef7453986bf43a6d921cd471a8bc0722c36a)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Doc/library/dataclasses.rst

index 37258d4ebc73869cc3cec829b995969db214ab50..10edcac7e8a9b67fadc0a87a3deea43cb3e379d6 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.'''