-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
ElvesAndDwarves #1361
base: master
Are you sure you want to change the base?
ElvesAndDwarves #1361
Conversation
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.
Thank you for your hard work on this project! While your code is mostly on the right track, there are a few critical issues that need to be addressed before we can approve the pull request:
-
Type Hinting: The
calculate_team_total_rating
function should useList[Player]
for theteam
parameter to align with the task requirements. This ensures that the function is flexible and can handle anyPlayer
type. -
Return Type Annotations: The
get_rating
method in theDwarfBlacksmith
class should have a return type ofint
, as it returnsself.skill_level
, which is expected to be an integer. -
Parameter Type Hinting: The
skill_level
parameter in theDwarfBlacksmith
class should be typed asint
instead ofNone
to accurately reflect its data type. -
Protected Attributes: Ensure that attributes like
skill_level
,hummer_level
,bow_level
, andfavourite_spell
are prefixed with an underscore to indicate they are protected, as per the task requirements.
These changes are important to ensure the functionality and adherence to the task requirements. Once these are addressed, your code will be in great shape! Keep up the great work, and don't hesitate to reach out if you have any questions or need further assistance. 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
🔄 Fix the issues, commit the changes, and then re-request my review using the Re-request review
button in the Reviewers tab.
app/main.py
Outdated
from typing import List | ||
|
||
|
||
def calculate_team_total_rating(team: List[Elf | Dwarf]) -> int: |
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 type hint for the team
parameter should be List[Player]
instead of List[Elf | Dwarf]
to match the task description, which specifies that the function should take a list of Player
s.
self, | ||
nickname: str, | ||
favourite_dish: str, | ||
skill_level: 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.
The skill_level
parameter should have a type hint that reflects its actual data type, such as int
, instead of None
.
f"{self.nickname} with skill of the " | ||
f"{self.skill_level} level") | ||
|
||
def get_rating(self) -> 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.
The get_rating
method should have a return type hint of int
instead of None
, as it returns self.skill_level
, which is expected to be an integer.
musical_instrument: str, | ||
favourite_spell: str | ||
) -> None: | ||
super().__init__(nickname, musical_instrument) |
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.
Ensure that the Elf
class constructor accepts nickname
and musical_instrument
as parameters. If the Elf
class constructor has different parameters, adjust the super().__init__()
call accordingly.
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.
Great!
print(f"" | ||
f"{self.nickname} is playing a song on the " | ||
f"{self.musical_instrument}") |
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.
print(f"" | |
f"{self.nickname} is playing a song on the " | |
f"{self.musical_instrument}") | |
print( | |
f"{self.nickname} is playing a song on the " | |
f"{self.musical_instrument}" | |
) |
No description provided.