Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.

Commit 9e8c639

Browse files
committed
Applied code formatting for conv_store.models
1 parent bfaecd6 commit 9e8c639

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/conv_store/models.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class Product:
2121
"""
2222

2323
def __init__(
24-
self, name: str, price: float, unit: Union[int, float]
24+
self, name: str, price: float, unit: Union[int, float]
2525
) -> None:
2626
"""Initialize instance
2727
@@ -59,8 +59,11 @@ def __eq__(self, other: object) -> bool:
5959
if not isinstance(other, Product):
6060
return False
6161

62-
return self.name == other.name and self.price == other.price and \
63-
self.unit == other.unit
62+
return (
63+
self.name == other.name and
64+
self.price == other.price and
65+
self.unit == other.unit
66+
)
6467

6568
def get_total(self, quantity: Union[int, float]) -> float:
6669
"""Return the total price for a specified amount of product"""
@@ -133,8 +136,8 @@ def remove_product(self, product: Product) -> None:
133136
self.quantities.pop(idx)
134137

135138
def add_product(
136-
self, product: Product,
137-
quantity: Optional[Union[int, float]] = None
139+
self, product: Product,
140+
quantity: Optional[Union[int, float]] = None
138141
) -> None:
139142
"""Add product to the shopping cart
140143
@@ -160,7 +163,7 @@ def add_product(
160163
self.remove_product(product)
161164

162165
def sub_product(
163-
self, product: Product, quantity: Union[int, float]
166+
self, product: Product, quantity: Union[int, float]
164167
) -> None:
165168
"""Subtract product from the shopping cart
166169

0 commit comments

Comments
 (0)