Skip to content

Software engineers 1#2242

Open
andersonmedeiros-bot wants to merge 8 commits into
mate-academy:masterfrom
andersonmedeiros-bot:master
Open

Software engineers 1#2242
andersonmedeiros-bot wants to merge 8 commits into
mate-academy:masterfrom
andersonmedeiros-bot:master

Conversation

@andersonmedeiros-bot

Copy link
Copy Markdown

No description provided.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

I am requesting changes because there are still a few critical issues that will break the required behavior and tests. The base class method is named learn_skills instead of learn_skill, which means any tests calling learn_skill will fail even though the logic is correct. The FrontendDeveloper.create_awesome_web_page method must return exactly "<h1>Hello world</h1>", but your implementation adds an exclamation mark, so string comparisons will not match. The AndroidDeveloper class is missing entirely, so the required features (default skills "Java", "Android studio" and the create_smooth_mobile_app method returning "Ads every three swipes") are not implemented. Also, FullStackDeveloper currently does not end up with both backend and frontend skills, and its __init__ overrides the parent just to call super().__init__, which violates the checklist about avoiding such overrides and prevents FrontendDeveloper.__init__ from contributing its skills.

To fix the critical points:

  • Rename learn_skills to learn_skill while keeping the existing behavior.
  • Change the return value of create_awesome_web_page to exactly "<h1>Hello world</h1>" (no exclamation mark).
  • Implement AndroidDeveloper(SoftwareEngineer) that extends skills with "Java" and "Android studio" in __init__, and add create_smooth_mobile_app that prints the required message and returns "Ads every three swipes".
  • Rework FullStackDeveloper so that, via multiple inheritance and/or cooperative __init__, both backend and frontend default skills are added, and avoid an __init__ that only calls super().__init__ with the same arguments. As a minor improvement, you can also simplify the __init__ signatures of FrontendDeveloper and BackendDeveloper to just (self, name: str) -> None and add missing type hints to satisfy the linter, but these style issues are secondary to the functional fixes. You’re very close; once these core requirements are addressed, your solution will align well with the task and checklist.

✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread app/main.py Outdated
self.name = name
self.skills = []

def learn_skills(self, skill):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Method name should be learn_skill (singular) to match the task requirements; with learn_skills tests calling learn_skill will fail.

Comment thread app/main.py Outdated

def create_awesome_web_page(self):
print(f"{self.name} is creating a webpage...")
return "<h1>Hello world!</h1>"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The return string must be exactly "<h1>Hello world</h1>" as specified; the extra exclamation mark will break exact string comparisons.

Comment thread app/main.py Outdated


class FrontendDeveloper(SoftwareEngineer):
def __init__(self, name, *args, **kwargs):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Overriding __init__ with only super().__init__(name, *args, **kwargs) adds no extra logic and contradicts checklist item #4 about avoiding such overrides; simplify the signature and/or add real logic if needed.

Comment thread app/main.py Outdated


class BackendDeveloper(SoftwareEngineer):
def __init__(self, name, *args, **kwargs):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Overriding __init__ with only super().__init__(name, *args, **kwargs) adds no extra logic and contradicts checklist item #4; this is the same pattern as the bad example in the checklist.

Comment thread app/main.py Outdated


class FullStackDeveloper(BackendDeveloper, FrontendDeveloper):
def __init__(self, name):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This __init__ only calls super().__init__(name) and adds no extra logic, which violates checklist items #3 and #4 about not overriding methods (especially __init__) when you only delegate to super with the same arguments.

Comment thread app/main.py
return "http://127.0.0.1:8000"


class FullStackDeveloper(BackendDeveloper, FrontendDeveloper):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Currently there is no AndroidDeveloper class in this file, but the description requires it with specific default skills and create_smooth_mobile_app method; you need to add that implementation.

Comment thread app/main.py Outdated
def __init__(self, name):
super().__init__(name)

def create_web_application(self):

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

With the current multiple inheritance and __init__ chain, FrontendDeveloper.__init__ is never called, so FullStackDeveloper.skills will lack frontend skills; adjust inheritance/initialization so both backend and frontend skills are included as required.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

I am requesting changes because there is still a critical checklist violation in app/main.py related to FullStackDeveloper.__init__, even though all functional requirements appear to work. Your __init__ currently calls super().__init__(name) and then manually assigns self.skills to a hard-coded combined list, which breaks [CHECKLIST ITEM #3] and the explicit rule about avoiding __init__ overrides that only delegate to super() and re‑do parent logic. This is critical because the task explicitly requires using cooperative multiple inheritance (or adjusted parent __init__ methods) so that a FullStackDeveloper’s skills are composed via the parent classes’ initialization, not by manually resetting self.skills in the child.

The concrete issue to fix is: in FullStackDeveloper.__init__ (check around the class definition for FullStackDeveloper in app/main.py), remove or refactor this method so that you either (1) don’t override __init__ at all and rely on the MRO to call both BackendDeveloper and FrontendDeveloper initializers cooperatively, or (2) implement a cooperative __init__ chain where each parent adds its own skills without you hardcoding the final list. In other words, FullStackDeveloper("Tom").skills should still end up with the correct backend + frontend skills, but that result must come from the parent classes’ logic (through super() chains), not from a manual combined list in FullStackDeveloper. Everything else in your solution—the classes, methods, prints, and return values—looks good and aligned with the specification, so once you adjust this __init__ design, your implementation will fully meet the requirements. Keep going; you’re very close and this change will give you cleaner, more maintainable multiple inheritance behavior.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread app/main.py


class FullStackDeveloper(BackendDeveloper, FrontendDeveloper):
def __init__(self, name: str) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This __init__ overrides the parent only to call super().__init__(name) and then manually assigns skills to a hard-coded list of backend + frontend skills. This violates checklist item #3 ("Make sure not to override a method, if you do not add additional logic inside") and the rule about avoiding __init__ overrides that just delegate to super(); instead, rely on cooperative multiple inheritance (or adjust parent __init__ methods) so that the combined skills come from the parents without manually resetting self.skills.

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Review Summary

I am approving your solution as an educational override so you can continue progressing while you refine your understanding of cooperative multiple inheritance.

You did a solid job implementing the required classes and methods: SoftwareEngineer, the specialized developer subclasses, and the skills list behavior all match the functional requirements, and your methods print/return the correct values. The main remaining issue is in app/main.py within FullStackDeveloper.__init__ (around the constructor definition): you currently call super().__init__(name) and then manually extend self.skills with frontend skills, which partially redoes parent logic and conflicts with the requirement that FullStackDeveloper("Tom").skills be composed only via parent initialization and [CHECKLIST ITEM #3]. To improve this, restructure your parent classes so each __init__ cooperates via super() and accumulates its own skills, and then let FullStackDeveloper either not define __init__ at all or only call super().__init__(name) without extra extend calls; this will also help avoid duplicate skills.

Overall, your design shows good understanding of inheritance and method behavior, and with a small refactor of the FullStackDeveloper initialization chain, you’ll fully align with the checklist and best practices for multiple inheritance.


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment thread app/main.py


class FullStackDeveloper(BackendDeveloper, FrontendDeveloper):
def __init__(self, name: str) -> None:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This __init__ violates the requirement that FullStackDeveloper("Tom").skills be composed via parent initialization logic rather than by manually recombining skills, and it conflicts with checklist item #3 about not overriding methods just to redo parent behavior. Refactor so that FullStackDeveloper relies on cooperative multiple inheritance (super() chains) to accumulate both backend and frontend skills, without manually extending self.skills here.

@meruyme meruyme left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parabéns pelo trabalho, Anderson! Seu código está 90% correto, mas serão necessárias algumas alterações no seu init da classe FullstackDeveloper, deixei uns comentários nas linhas específicas para ficar mais fácil de você consultar! Após essas modificações, seu código estará pronto para aprovação.

Continue assim e bons estudos!

Comment thread app/main.py Outdated
class FullStackDeveloper(BackendDeveloper, FrontendDeveloper):
def __init__(self, name: str) -> None:
super().__init__(name)
self.skills.extend(["JavaScript", "HTML", "CSS"])

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Anderson, aqui você não precisa fazer esse extends novamente, como você está chamando o init das duas classes pai (o Python faz isso automaticamente quando temos heranças múltiplas e usamos o init com o super), o skills já está com os dados referentes do FrontendDeveloper.

Comment thread app/main.py Outdated
def __init__(self, name: str) -> None:
super().__init__(name)
self.skills.extend(["JavaScript", "HTML", "CSS"])
self.skills = list(dict.fromkeys(self.skills))

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Não precisa dessa linha aqui também, creio que você a usou para remover os duplicados, mas se você já remover a linha acima dessa, não haverá duplicatas na lista!

@meruyme meruyme left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Parabéns pelo trabalho, Anderson! Vi que você seguiu minhas orientações, seu código está 100% correto agora!

Continue com o bom trabalho e bons estudos!

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.

3 participants