mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Make the first dataclass example more useful (GH-19994)
This commit is contained in:
parent
d2c349b190
commit
2effef7453
1 changed files with 2 additions and 0 deletions
|
@ -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.'''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue