-
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
Solution #1239
base: master
Are you sure you want to change the base?
Solution #1239
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.
Hey there! 😊 Your code structure and use of inheritance is spot on! However, there are a couple of issues that need to be addressed before we can proceed. Firstly, you're overriding the __init__
method in the FullStackDeveloper
class without adding any additional logic. If there's no new logic to add, there's no need to override the method. Secondly, when adding multiple values to a list, it's more efficient to use extend()
or +=
instead of appending each item individually. Let's make these changes and your code will be good to go! Keep up the good work! 👍
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
app/main.py
Outdated
def add_skills(self, skills_list: list) -> None: | ||
for skill in skills_list: | ||
self.skills.append(skill) |
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.
You're appending each skill one-by-one in a loop, which is not efficient. Instead of using append()
in a loop, you should use extend()
or +=
operator to add multiple values to a list. This is more efficient and also makes the code cleaner. This is related to the first point in the checklist.
app/main.py
Outdated
def __init__(self, name: str) -> None: | ||
super().__init__(name) |
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.
You're overriding the __init__
method of the FullStackDeveloper
class but you're not adding any additional logic inside it. This is considered a bad practice. If you don't need to add any additional logic, there's no need to override the method. This is related to the third point in the checklist.
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 job on your code! 😊 However, there's a small issue with the FullStackDeveloper
class where you're overriding the create_web_application
method without adding any additional logic. This is considered a bad practice. Try to fix this by either moving the method to the SoftwareEngineer
base class or adding some extra logic in the method within the FullStackDeveloper
class. Keep up the good work! 👍
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
app/main.py
Outdated
class FullStackDeveloper(FrontendDeveloper, BackendDeveloper): | ||
def create_web_application(self) -> None: | ||
print(f"{self.name} started creating a web application...") | ||
super().create_powerful_api() | ||
super().create_awesome_web_page() |
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.
You are overriding the create_web_application
method in the FullStackDeveloper
class but you are not adding any additional logic inside. According to the checklist, this is considered a bad practice. You should only override a method if you are adding additional logic inside. In this case, you could move the create_web_application
method to the SoftwareEngineer
base class and avoid overriding it in the FullStackDeveloper
class. Alternatively, if you want to keep the method in the FullStackDeveloper
class, you should add some additional logic inside, such as logging or error handling.
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 work on your code! There are a few areas that need improvement, notably the unnecessary overriding of the __init__()
method in the FullStackDeveloper
class and the inconsistent use of append()
and extend()
methods when adding values to the skills
list. Please review the comments and make the necessary changes. Remember, the goal is to learn and improve. Keep it up! 👍
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
class FrontendDeveloper(SoftwareEngineer): | ||
def __init__(self, name: str) -> None: | ||
super().__init__(name) | ||
self.skills.extend(["JavaScript", "HTML", "CSS"]) |
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.
You are using extend()
method here to add multiple values to the skills
list, which is a good practice according to the checklist. However, you are not following this practice consistently throughout your code.
class BackendDeveloper(SoftwareEngineer): | ||
def __init__(self, name: str) -> None: | ||
super().__init__(name) | ||
self.skills.extend(["Python", "SQL", "Django"]) |
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.
Here, you are again using extend()
method to add multiple values to the skills
list. This is good.
class AndroidDeveloper(SoftwareEngineer): | ||
def __init__(self, name: str) -> None: | ||
super().__init__(name) | ||
self.skills.extend(["Java", "Android studio"]) |
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.
Here, you are again using extend()
method to add multiple values to the skills
list. This is good.
self.skills = [] | ||
|
||
def learn_skill(self, skill: str) -> None: | ||
self.skills.append(skill) |
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.
You are using append()
method here to add a single value to the skills
list. According to the checklist, you should use extend()
method or +=
operator even when adding a single value to a list. Please, correct this.
|
||
|
||
class FullStackDeveloper(FrontendDeveloper, BackendDeveloper): | ||
def create_web_application(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.
You are overriding the __init__()
method in the FullStackDeveloper
class without adding any additional logic. This is a bad practice according to the checklist. You should remove the __init__()
method from the FullStackDeveloper
class.
No description provided.