From: Ned Batchelder Date: Fri, 8 May 2020 11:39:57 +0000 (-0400) Subject: Make the first dataclass example more useful (GH-19994) X-Git-Tag: v3.9.0b1~134 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2effef7453986bf43a6d921cd471a8bc0722c36a;p=thirdparty%2FPython%2Fcpython.git Make the first dataclass example more useful (GH-19994) --- diff --git a/Doc/library/dataclasses.rst b/Doc/library/dataclasses.rst index c125a1130a96..fe63d20671dd 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.'''