Skip to content

Commit 5d555fa

Browse files
Make the first dataclass example more useful (GH-19994) (GH-19998)
(cherry picked from commit 2effef7) Co-authored-by: Ned Batchelder <ned@nedbatchelder.com> Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
1 parent 2501428 commit 5d555fa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Doc/library/dataclasses.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ in :pep:`557`.
1919
The member variables to use in these generated methods are defined
2020
using :pep:`526` type annotations. For example this code::
2121

22+
from dataclasses import dataclass
23+
2224
@dataclass
2325
class InventoryItem:
2426
'''Class for keeping track of an item in inventory.'''

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy