Skip to content
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 #648

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Solution #648

wants to merge 3 commits into from

Conversation

okdzeryn
Copy link

@okdzeryn okdzeryn commented Dec 9, 2024

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a 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! 😊 There are a couple of critical issues that need to be addressed to ensure the code functions correctly.

  1. The __get__ method in the IntegerRange class should return the value of the attribute, but it currently returns None. This needs to be corrected to ensure that the attribute value is properly retrieved.

  2. The Slide class incorrectly uses Class from pyclbr for instantiation, which is not appropriate. You should use type or a specific class type that can be instantiated instead.

Once these issues are resolved, your code will be in great shape! Keep up the great work, and I'm looking forward to seeing the improvements. 🚀

✨ 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
@@ -1,25 +1,68 @@
from abc import ABC
from pyclbr import Class

Choose a reason for hiding this comment

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

The import from pyclbr import Class is incorrect for the intended usage. Class from pyclbr is not meant to be used as a type for instantiation. Consider using type or a specific class type that can be instantiated.

app/main.py Outdated
def __set_name__(self, owner: Any, name: str) -> None:
self.protected_name = f"_{name}"

def __get__(self, instance: Any, owner: Any) -> None:

Choose a reason for hiding this comment

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

The __get__ method should return the value of the attribute, but it currently returns None. Change the return type to Any to reflect that it should return the attribute value.

Copy link

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

Choose a reason for hiding this comment

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

Review Summary

Great job on addressing the previous issues and improving the code! 🎉 The code now meets the task requirements and constraints, and all necessary classes and methods are implemented correctly. However, there are a couple of areas that could still use some attention:

  1. __get__ Method in IntegerRange Class: The method should return the value as a string, as indicated by its return type annotation -> str. Consider converting the returned value to a string to align with the expected behavior.

  2. limitation_class Check in Slide Class: It would be beneficial to add a check to ensure that limitation_class is a subclass of SlideLimitationValidator. This will prevent incorrect usage and ensure that only valid limitation classes are used with the Slide class.

Despite these minor issues, the decision is to APPROVE the Pull Request to help you move forward with your learning. Please review the comments and consider making these improvements in future iterations. Keep up the good work and continue to learn from your experiences! 🚀

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

Comment on lines +14 to +15
def __get__(self, instance: Any, owner: Any) -> str:
return getattr(instance, self.protected_name)

Choose a reason for hiding this comment

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

The __get__ method in the IntegerRange class should return the value as a string, as indicated by its return type annotation -> str. Consider converting the returned value to a string.

Comment on lines +56 to +58
def __init__(self, name: str, limitation_class: type) -> None:
self.name = name
self.limitation_class = limitation_class

Choose a reason for hiding this comment

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

Consider adding a check to ensure that limitation_class is a subclass of SlideLimitationValidator to prevent incorrect usage. This will ensure that only valid limitation classes are used with the Slide class.

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