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' #538

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

'Solution' #538

wants to merge 3 commits into from

Conversation

hanovskyiv
Copy link

No description provided.

app/cafe.py Outdated Show resolved Hide resolved
app/cafe.py Outdated Show resolved Hide resolved
app/main.py Outdated Show resolved Hide resolved
Copy link

@Dimosphen1 Dimosphen1 left a comment

Choose a reason for hiding this comment

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

LGTM, well done! Several comments are left for consideration.

def visit_cafe(self, visitor: dict) -> str:
if "vaccine" not in visitor:
raise NotVaccinatedError
if datetime.date.today() > visitor["vaccine"]["expiration_date"]:

Choose a reason for hiding this comment

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

It would be preferable to place at the first position a value that you want to check from the function input and the value you check against in the second position.

def visit_cafe(self, visitor: dict) -> str:
if "vaccine" not in visitor:
raise NotVaccinatedError
if datetime.date.today() > visitor["vaccine"]["expiration_date"]:

Choose a reason for hiding this comment

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

In case you are unsure about the incoming dict structure, it would be preferable to use .get() in production settings to retrieve the required values.

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.

4 participants