mirror of
https://github.com/python/cpython.git
synced 2025-01-06 00:25:19 +08:00
Make the first dataclass example more useful (GH-19994)
This commit is contained in:
parent
d2c349b190
commit
2effef7453
@ -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…
Reference in New Issue
Block a user