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

Implemented py-lockdown-cafe #545

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

Conversation

Illia-Kononenko
Copy link

No description provided.

app/cafe.py Outdated
Comment on lines 12 to 17
def visit_cafe(self,
visitor: dict
) -> (str
| NotVaccinatedError
| OutdatedVaccineError
| NotWearingMaskError):

Choose a reason for hiding this comment

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

the function doesn't return errors it raises them

app/cafe.py Outdated
Comment on lines 12 to 14
def visit_cafe(self,
visitor: dict
) -> (str

Choose a reason for hiding this comment

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

fix indentation

Choose a reason for hiding this comment

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

the same in other similar cases

app/cafe.py Outdated
raise OutdatedVaccineError

if not visitor.get("wearing_a_mask", False):
raise NotWearingMaskError(masks_to_buy=0)

Choose a reason for hiding this comment

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

maybe it's better to use a default value for your custom error?

except NotWearingMaskError as e:
if not not_wearing_mask_error:
not_wearing_mask_error = e
if not_wearing_mask_error:

Choose a reason for hiding this comment

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

why didn't use else?

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