-
Notifications
You must be signed in to change notification settings - Fork 725
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Solution-py-shop-trip #406
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolve flake8
errors for further assessment.
I resolved flake8 errors. |
I don't understand why it is not possible to import: : ImportError: cannot import name 'Customer' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Several changes were requested.
app/shop/shop.py
Outdated
import datetime | ||
from typing import Dict, Any | ||
|
||
from app.customer.customer import Customer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You cannot import Customer
here because you import Shop
inside of the app/customer/customer.py
. You could read more about cyclic imports in Python and try to resolve them by reformatting the project structure upon the next pull request.
I have an issue with calculation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Resolve issues with tests and comments that are left in the PR upon the new review request.
|
||
def shop_trip() -> None: | ||
with open("app/config.json", "r") as config_file: | ||
config_data = json.load(config_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not overload the context manager, place logic not related to the file management outside of its scope.
[ | ||
self.product_cart[product] * shop.products[product] | ||
for product in self.product_cart | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not use list comprehension inside of sum
, use generator expression instead.
No description provided.