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

Title #1211

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

Title #1211

wants to merge 4 commits into from

Conversation

KrenkySpenky
Copy link

No description provided.

app/main.py Outdated
class FlyingRobot(BaseRobot):
def __init__(self, name: str, weight: int, coords: list = None) -> None:
coords = coords or [0, 0, 0]
super().__init__(name, weight, coords)

Choose a reason for hiding this comment

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

Instead coords = coords or [0, 0, 0], directly set coords=coords or [0, 0, 0] into init method

coords: list = None
) -> None:
coords = coords or [0, 0, 0]
super().__init__(name, weight, coords)

Choose a reason for hiding this comment

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

Same here as well

app/main.py Outdated

class BaseRobot:
def __init__(self, name: str, weight: int, coords: list = None) -> None:
coords = coords or [0, 0]
Copy link

Choose a reason for hiding this comment

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

Suggested change
coords = coords or [0, 0]
self.coords = coords or [0, 0]

app/main.py Outdated
coords = coords or [0, 0]
self.name = name
self.weight = weight
self.coords = coords
Copy link

Choose a reason for hiding this comment

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

And you can remove this

app/main.py Outdated
Comment on lines 31 to 32
self.coords = coords or [0, 0, 0]
super().__init__(name, weight, self.coords)
Copy link

Choose a reason for hiding this comment

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

Suggested change
self.coords = coords or [0, 0, 0]
super().__init__(name, weight, self.coords)
super().__init__(name, weight, coords or [0, 0, 0])

app/main.py Outdated
Comment on lines 50 to 51
self.coords = coords or [0, 0, 0]
super().__init__(name, weight, self.coords)
Copy link

Choose a reason for hiding this comment

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

Suggested change
self.coords = coords or [0, 0, 0]
super().__init__(name, weight, self.coords)
super().__init__(name, weight, coords)

Since parent class will do the same

Copy link

@viktoria-rybenchuk viktoria-rybenchuk left a comment

Choose a reason for hiding this comment

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

LGTM!

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