Refactor DFA and NFA definition to make use of dataclasses, replace __init__ with dataclasses.
Refac this...
def __init__(self, name: str, unit_price: float, quantity_on_hand: int = 0):
self.name = name
self.unit_price = unit_price
self.quantity_on_hand = quantity_on_hand
to this...
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
Refactor DFA and NFA definition to make use of dataclasses, replace
__init__
with dataclasses.Refac this...
to this...