Conversation
IlyaOrlov
left a comment
There was a problem hiding this comment.
Всё хорошо. Оставил замечания по мелочи.
|
|
||
| def solve_task(self): | ||
| time.sleep(random.randint(3, 6)) | ||
| print("I'm not ready yet") |
There was a problem hiding this comment.
Лучше вместо стр.25 просто сослаться на одноименный родительский метод через super(). Тогда если у solve_task() в классе Man логика поменяется - не придется менять ее и у Pupil.
| else: | ||
| print("The tank does not fire") | ||
|
|
||
| def showTanks(self): |
There was a problem hiding this comment.
Методы надо именовать в snake_case
| return f'Утка {self._name}, весит {self._weight}' | ||
|
|
||
| def __lt__(self, other): | ||
| if self._weight > other._weight: |
There was a problem hiding this comment.
А что должно вернуться в противном случае?
| return f'Более тяжёлая утка - {self._name}' | ||
|
|
||
| def __ne__(self, other): | ||
| if self._weight != other._weight: |
There was a problem hiding this comment.
Можно упростить до return self._weight != other._weight
|
|
||
|
|
||
| @property | ||
|
|
There was a problem hiding this comment.
Пустые строки 21, 38, 49 - лишние. Отделять декоратор от декорируемой функции не нужно.
| # На этот раз он будет думать от 3 до 6 секунд (c помощью метода sleep библиотеки time и randint библиотеки random). | ||
|
|
||
| class Pupil(Man): | ||
| def __init__(self, pupilname): |
There was a problem hiding this comment.
А нужен ли Pupil свой __init__? Он же и так наследует этот метод у родителя.
Task 1, 2, 3 Lec 7; Task 1, 2 Lec 8.1