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 #274

Closed
wants to merge 4 commits into from
Closed

solution #274

wants to merge 4 commits into from

Conversation

ivanzh13
Copy link

No description provided.

app/main.py Outdated
Comment on lines 41 to 42
def __init__(self, age: int, weight: int, height: int) -> None:
super().__init__(age, weight, height)

Choose a reason for hiding this comment

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

These lines are not needed. Remove them

app/main.py Outdated
Comment on lines 50 to 51
def __init__(self, age: int, weight: int, height: int) -> None:
super().__init__(age, weight, height)

Choose a reason for hiding this comment

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

These lines are not needed. Remove them

app/main.py Outdated
def __init__(
self,
name: str,
limitation_class: SlideLimitationValidator

Choose a reason for hiding this comment

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

It accepts type, not instance

app/main.py Outdated
Comment on lines 52 to 54
limitation_class: (
ChildrenSlideLimitationValidator | AdultSlideLimitationValidator
)

Choose a reason for hiding this comment

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

It accepts type of SlideLimitationValidator, not instances

app/main.py Outdated
self.min_amount = min_amount
self.max_amount = max_amount

def __set_name__(self, instance, name: str) -> None: # noqa

Choose a reason for hiding this comment

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

noqa? why you need it? delete please

Copy link
Author

Choose a reason for hiding this comment

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

Do you can explain me how write correct type hint for descriptor's methods?

Choose a reason for hiding this comment

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

object is a good idea for annotation

@ivanzh13 ivanzh13 closed this by deleting the head repository Sep 18, 2023
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