-
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' #549
base: master
Are you sure you want to change the base?
'Solution' #549
Conversation
app/main.py
Outdated
if coords is None: | ||
coords = [0, 0] | ||
if isinstance(self, FlyingRobot): | ||
coords.append(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.
Use ternary operator and write it in 1 line
app/main.py
Outdated
def __init__(self, | ||
name: str, | ||
weight: int, | ||
coords: list[int] = 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.
Add Optional to annotation
app/main.py
Outdated
def __init__(self, | ||
name: str, | ||
weight: int, | ||
coords: list[int] = 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.
Add Optional to annotation
app/main.py
Outdated
weight: int, | ||
max_load_weight: int, | ||
current_load: int, | ||
coords: list[int] = 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.
Add Optional to annotation
app/main.py
Outdated
def __init__(self, | ||
name: str, | ||
weight: int, | ||
coords: list[int, int] = 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.
use typehint like: Optional[YOUR_VALUE_TYPE] = None
for example: list that contains string elements and can be None has typehint Optional[list[str]]
app/main.py
Outdated
def __init__(self, | ||
name: str, | ||
weight: int, | ||
coords: list[int, int, int] = 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.
use typehint like: Optional[YOUR_VALUE_TYPE] = None
for example: list that contains string elements and can be None has typehint Optional[list[str]]
app/main.py
Outdated
weight: int, | ||
max_load_weight: int, | ||
current_load: int, | ||
coords: list[int, int, int] = 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.
use typehint like: Optional[YOUR_VALUE_TYPE] = None
for example: list that contains string elements and can be None has typehint Optional[list[str]]
app/main.py
Outdated
def __init__(self, | ||
name: str, | ||
weight: int, | ||
coords: Optional[list[int, int]] = 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.
coords: Optional[list[int, int]] = None) -> None: | |
coords: Optional[list[int]] = None) -> None: |
app/main.py
Outdated
def __init__(self, | ||
name: str, | ||
weight: int, | ||
coords: Optional[list[int, int, int]] = 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.
coords: Optional[list[int, int, int]] = None) -> None: | |
coords: Optional[list[int]] = None) -> None: |
app/main.py
Outdated
weight: int, | ||
max_load_weight: int, | ||
current_load: int, | ||
coords: Optional[list[int, int, int]] = 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.
coords: Optional[list[int, int, int]] = None) -> None: | |
coords: Optional[list[int]] = 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.
Good job
No description provided.