Make the first dataclass example more useful (GH-19994) · python/cpython@2effef7 (original) (raw)
Navigation Menu
- Explore
- Pricing
Provide feedback
Saved searches
Use saved searches to filter your results more quickly
Appearance settings
Commit 2effef7
Make the first dataclass example more useful (GH-19994)
File tree
1 file changed
lines changed
1 file changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -19,6 +19,8 @@ in :pep:`557`. | ||
19 | 19 | The member variables to use in these generated methods are defined |
20 | 20 | using :pep:`526` type annotations. For example this code:: |
21 | 21 | |
22 | + from dataclasses import dataclass | |
23 | + | |
22 | 24 | @dataclass |
23 | 25 | class InventoryItem: |
24 | 26 | '''Class for keeping track of an item in inventory.''' |