from dataclasses import dataclass
@dataclass
class InventoryItem:
"""Class for keeping track of an item in inventory."""
name: str | None = None
unit_price: float
quantity_on_hand: int = 0
TypeError: unsupported operand type(s) for |: 'type' and 'NoneType'
Python 3.9
I think the problem is using the latest version of python, how to solve it.
i tried use 'or' but it didn't help