-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 #1252
base: master
Are you sure you want to change the base?
solution #1252
Conversation
app/main.py
Outdated
self, | ||
name: str, | ||
weight: int, | ||
coords: Optional[List[int]] = None |
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.
We can use |
and list
from python3.10, so if your python version is 3.10+ fix it(in other places too)
coords: Optional[List[int]] = None | |
coords: list[int] | None = None |
app/main.py
Outdated
|
||
self.name = name | ||
self.weight = weight | ||
self.coords = coords if coords is not None else [0, 0] |
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.
Refactor using or
app/main.py
Outdated
self.current_load = current_load | ||
|
||
def hook_load(self, cargo: Cargo) -> None: | ||
if self.current_load is None and cargo.weight <= self.max_load_weight: |
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.
Use not
here
if self.current_load is None and cargo.weight <= self.max_load_weight: | |
if not self.current_load and cargo.weight <= self.max_load_weight: |
No description provided.