Skip to content

aturenko#95

Open
Wiwingsy wants to merge 2 commits into
mainfrom
aturenko
Open

aturenko#95
Wiwingsy wants to merge 2 commits into
mainfrom
aturenko

Conversation

@Wiwingsy
Copy link
Copy Markdown
Collaborator

@Wiwingsy Wiwingsy commented Nov 5, 2022

Task 1, 2, 3 Lec 7; Task 1, 2 Lec 8.1

Copy link
Copy Markdown
Owner

@IlyaOrlov IlyaOrlov left a comment

Choose a reason for hiding this comment

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

Всё хорошо. Оставил замечания по мелочи.


def solve_task(self):
time.sleep(random.randint(3, 6))
print("I'm not ready yet")
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Лучше вместо стр.25 просто сослаться на одноименный родительский метод через super(). Тогда если у solve_task() в классе Man логика поменяется - не придется менять ее и у Pupil.

else:
print("The tank does not fire")

def showTanks(self):
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Методы надо именовать в snake_case

return f'Утка {self._name}, весит {self._weight}'

def __lt__(self, other):
if self._weight > other._weight:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

А что должно вернуться в противном случае?

return f'Более тяжёлая утка - {self._name}'

def __ne__(self, other):
if self._weight != other._weight:
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Можно упростить до return self._weight != other._weight



@property

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Пустые строки 21, 38, 49 - лишние. Отделять декоратор от декорируемой функции не нужно.

# На этот раз он будет думать от 3 до 6 секунд (c помощью метода sleep библиотеки time и randint библиотеки random).

class Pupil(Man):
def __init__(self, pupilname):
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

А нужен ли Pupil свой __init__? Он же и так наследует этот метод у родителя.

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