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_1 #1203

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

Solution_1 #1203

wants to merge 2 commits into from

Conversation

apmaz
Copy link

@apmaz apmaz commented Sep 6, 2024

No description provided.

Copy link

@Dimosphen1 Dimosphen1 left a comment

Choose a reason for hiding this comment

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

Several changes were requested

app/main.py Outdated
Comment on lines 17 to 22
if coords is None:
coords = [0, 0]

self.name = name
self.weight = weight
self.coords = coords

Choose a reason for hiding this comment

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

Avoid using if condition, perform assignment in one line using either if condition

Suggested change
if coords is None:
coords = [0, 0]
self.name = name
self.weight = weight
self.coords = coords
self.name = name
self.weight = weight
self.coords = coords if coords else [0, 0]

or or expression

Suggested change
if coords is None:
coords = [0, 0]
self.name = name
self.weight = weight
self.coords = coords
self.name = name
self.weight = weight
self.coords = coords or [0, 0]

app/main.py Outdated
Comment on lines 49 to 52
if coords is None:
coords = [0, 0, 0]

super().__init__(name=name, weight=weight, coords=coords)

Choose a reason for hiding this comment

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

Perform the assignment directly in the super().__init__(

Suggested change
if coords is None:
coords = [0, 0, 0]
super().__init__(name=name, weight=weight, coords=coords)
super().__init__(name=name, weight=weight, coords=coords or [0, 0, 0])

Copy link

@pavlopro pavlopro left a comment

Choose a reason for hiding this comment

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

GJ!

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.

3 participants