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' #549

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

'Solution' #549

wants to merge 4 commits into from

Conversation

Rovalexx
Copy link

No description provided.

app/main.py Outdated
Comment on lines 13 to 16
if coords is None:
coords = [0, 0]
if isinstance(self, FlyingRobot):
coords.append(0)

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:

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:

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:

Choose a reason for hiding this comment

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

Add Optional to annotation

@Rovalexx Rovalexx requested a review from olena-hul July 18, 2023 19:45
app/main.py Outdated
def __init__(self,
name: str,
weight: int,
coords: list[int, int] = None) -> None:

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:

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:

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:

Choose a reason for hiding this comment

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

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

Choose a reason for hiding this comment

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

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

Choose a reason for hiding this comment

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

Suggested change
coords: Optional[list[int, int, int]] = None) -> None:
coords: Optional[list[int]] = None) -> None:

Copy link

@EdAlekseiev EdAlekseiev left a comment

Choose a reason for hiding this comment

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

Good job

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