from itertools import count from data.ItemType import ItemType class Item: id_counter = count(start=0) def __init__(self, type: ItemType): self.id = next(self.id_counter) self.category = type self.price = self.price_factory(type) @staticmethod def price_factory(self, type: ItemType): return 1