summaryrefslogtreecommitdiff
path: root/tests/regrtest_data/dataclasses_pyreverse/__init__.py
blob: e4c92334349772d0f44f739c3e335fed6ae3cfee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
from dataclasses import dataclass


@dataclass
class InventoryItem:
    """Class for keeping track of an item in inventory."""

    name: str
    unit_price: float
    quantity_on_hand: int = 0

    def total_cost(self) -> float:
        return self.unit_price * self.quantity_on_hand