-
Notifications
You must be signed in to change notification settings - Fork 612
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 #623
base: master
Are you sure you want to change the base?
solution #623
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.
Great job on implementing the system for validating visitor access to slides! 🎉 Your code meets the task requirements and constraints effectively. While there are a few areas for improvement, such as adding descriptive messages to exceptions and ensuring limitation_class
is an instance rather than a class, these are minor issues that don't impact the core functionality. Keep up the great work and consider these suggestions for future enhancements! 😊
✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨
|
||
def __set__(self, instance: Any, value: Any) -> None: | ||
if not isinstance(value, int): | ||
raise TypeError |
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 TypeError
raised here lacks a descriptive message. Consider adding a message to indicate that the value must be an integer.
raise TypeError | ||
|
||
if value < self.min_amount or value > self.max_amount: | ||
raise ValueError |
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 ValueError
raised here lacks a descriptive message. Consider adding a message to indicate that the value must be within the specified range.
limitation_class: SlideLimitationValidator | ||
) -> None: | ||
self.name = name | ||
self.limitation_class = limitation_class |
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 limitation_class
should be an instance of a validator class, not the class itself. Consider instantiating the validator class before assigning it to self.limitation_class
.
No description provided.