I just came across this code:
class Batch:
def __init__(self, ref: str, sku: str, qty: int, eta: Optional[date]):
self.reference = ref
self.sku = sku
self.eta = eta
self._purchased_quantity = qty
self._allocations = set() # type: Set[OrderLine]
I take it that last line is to do with mypy, but I’m not sure how it works. Could it not simply be this?
class Batch:
def __init__(self, ref: str, sku: str, qty: int, eta: Optional[date]):
...
self._allocations: Set[OrderLine] = set()