From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Fri, 8 May 2020 11:52:10 +0000 (-0700) Subject: Make the first dataclass example more useful (GH-19994) (GH-19997) X-Git-Tag: v3.8.3~2 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=546f643487f5116b795983c951141e0de78a0049;p=thirdparty%2FPython%2Fcpython.git Make the first dataclass example more useful (GH-19994) (GH-19997) (cherry picked from commit 2effef7453986bf43a6d921cd471a8bc0722c36a) Co-authored-by: Ned Batchelder Co-authored-by: Ned Batchelder --- diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst index 37258d4ebc73..10edcac7e8a9 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.'''