-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
base: master
Are you sure you want to change the base?
'Solution' #538
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.
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"]: |
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.
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"]: |
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.
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.
No description provided.