-
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 #1197
base: master
Are you sure you want to change the base?
Solution #1197
Conversation
app/main.py
Outdated
) -> None: | ||
super().__init__(weight) | ||
self.name = name | ||
if coords is 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.
Simplify to
self.coords = coords or [0, 0]
app/main.py
Outdated
weight: int, | ||
coords: list = None | ||
) -> None: | ||
super().__init__(name, weight, coords) |
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.
simplify to super().__init__(name, weight, coords or [0, 0, 0])
app/main.py
Outdated
weight: int, | ||
coords: list = None, | ||
max_load_weight: int = 0, | ||
current_load: 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.
Correct annotation for current_load
You should cover both Cargo and None in annotations for current_load
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.
Cargo | None = 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.
current_load: Cargo | None = None
app/main.py
Outdated
weight: int, | ||
coords: list = None, | ||
max_load_weight: int = 0, | ||
current_load: 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.
Cargo | None = None
app/main.py
Outdated
weight: int, | ||
coords: list = None, | ||
max_load_weight: int = 0, | ||
current_load: 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.
current_load: Cargo | None = None
app/main.py
Outdated
def __init__(self, | ||
name: str, | ||
weight: int, | ||
coords: list = None | ||
) -> 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.
place each argument including self on a new line
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.
Well done!
No description provided.