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

clarify task description #1276

Merged

Conversation

LLkaia
Copy link
Contributor

@LLkaia LLkaia commented Oct 25, 2024

No description provided.

README.md Outdated
Comment on lines 13 to 15
It is not a good practice to use mutable object as a default parameter of function,
set it to `None` by default. But in constructor itself you can use condition, and if `coords` equal to None,
assign [0, 0] to the `coords`.
Copy link
Contributor

Choose a reason for hiding this comment

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

Checklist item maybe?

README.md Outdated
Comment on lines 49 to 51
- the `__init__` method also takes and stores `max_load_weight` and `current_load`.
`max_load_weight` purpose is to store robot's load capacity.
`current_load` purpose is to store `Cargo` instance, and it can be None by default.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- the `__init__` method also takes and stores `max_load_weight` and `current_load`.
`max_load_weight` purpose is to store robot's load capacity.
`current_load` purpose is to store `Cargo` instance, and it can be None by default.
- the `__init__` method also takes and stores `max_load_weight` and `current_load`:
- `max_load_weight` purpose is to store the robot's load capacity;
- `current_load` purpose is to store the `Cargo` instance, which can be None by default.

README.md Outdated
Comment on lines 54 to 57
`current_load` if two conditions are True: `current_load` is set
to `None` and `cargo.weight` not greater than`max_load_weight`
of the drone, otherwise, do nothing.
- has `unhook_load` method, that set `current_load` to None without any additional logic.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
`current_load` if two conditions are True: `current_load` is set
to `None` and `cargo.weight` not greater than`max_load_weight`
of the drone, otherwise, do nothing.
- has `unhook_load` method, that set `current_load` to None without any additional logic.
`current_load` if two conditions are True: `current_load` is set to `None` and `cargo.weight` is not greater than `max_load_weight` of the drone. Otherwise, do nothing.
- has `unhook_load` method, that sets `current_load` to None without any additional logic.

- `go_forward`, `go_back`, `go_right` and `go_left` methods
take a `step` argument (1 by default) and move the robot by
`step` in the appropriate direction.
Positive Y axis is forward, positive X axis is right.
These functions should not return anything.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
These functions should not return anything.
These functions should not return anything.

Let's add extra spaces between all list items

checklist.md Outdated
Comment on lines 4 to 11
```
def long_function_name(
var_one,
var_two,
var_three,
var_four
) -> None:
```
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
```
def long_function_name(
var_one,
var_two,
var_three,
var_four
) -> None:
```
**Good example:**
```python
def long_function_name(
var_one,
var_two,
var_three,
var_four
) -> None:

checklist.md Outdated
Comment on lines 12 to 16
2. If a variable can be `None`, you need to specify it in the annotation.
3. Make sure you're not repeating yourself. If something can be done in the parent class, delegate it there.
4. Remember, if you want to check if a variable is set to `None` and assign a default value to it,
you can use the ternary operator: `variable = other if other else 0`.
Or even simpler: `variable = other or 0`. Simple is better than complex.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
2. If a variable can be `None`, you need to specify it in the annotation.
3. Make sure you're not repeating yourself. If something can be done in the parent class, delegate it there.
4. Remember, if you want to check if a variable is set to `None` and assign a default value to it,
you can use the ternary operator: `variable = other if other else 0`.
Or even simpler: `variable = other or 0`. Simple is better than complex.
2. If a variable can be `None`, specify it in the annotation.
3. Make sure you're not repeating yourself. If something can be done in the parent class, delegate it there.
4. To check if a variable is set to `None` and assign a default value, use the ternary operator: `variable = other if other else 0`. Or even simpler: `variable = other or 0`.
Remember, a simple way is better than a complex one.

@sergii-nosachenko sergii-nosachenko merged commit 2cd4f48 into mate-academy:master Oct 25, 2024
1 check failed
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.

2 participants