Skip to content
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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

solution #1252

wants to merge 2 commits into from

Conversation

YaYaYaroslav
Copy link

No description provided.

app/main.py Outdated
self,
name: str,
weight: int,
coords: Optional[List[int]] = None

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)

Suggested change
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]

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:

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use not here

Suggested change
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:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants