You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromtypingimportUnionfromdatafilesimportdatafile, Missing@datafile("inventory/items/{self.name}.yml")classInventoryItem:
"""Class for keeping track of an item in inventory."""name: strunit_price: floatquantity_on_hand: Union[int, float] =0item=InventoryItem("widget", 3)
While it's not full support for Union types, #272 will handle Union[str, ...] (treated as the broader str type) and Union[int, float] (treated as the broader float type).
I'm seeing an error when using Union type.
The text was updated successfully, but these errors were encountered: