-
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
clarify task description #1276
clarify task description #1276
Conversation
README.md
Outdated
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`. |
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.
Checklist item maybe?
README.md
Outdated
- 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. |
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.
- 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
`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. |
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.
`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. |
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.
These functions should not return anything. | |
These functions should not return anything. | |
Let's add extra spaces between all list items
checklist.md
Outdated
``` | ||
def long_function_name( | ||
var_one, | ||
var_two, | ||
var_three, | ||
var_four | ||
) -> 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.
``` | |
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
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. |
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.
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. |
No description provided.