Skip to content

typing hint in _deserialize (image.py) #6

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

csabaszeles
Copy link

Added type hinting for None type return as well, as PyCharm highlights it as well:
-> Union[None, FileStorage]

Added type hinting for None type return as well, as PyCharm highlights it as well:
-> Union[None, FileStorage]
Copy link
Contributor

@jslvtr jslvtr left a comment

Choose a reason for hiding this comment

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

Thank you for this! I was wondering about Optional[FileStorage] as an alternative but after considering it carefully, it reads better (to me) that Optional be used only in the parameters, and not in the return value.

Copy link
Contributor

@jslvtr jslvtr left a comment

Choose a reason for hiding this comment

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

Cancelling approval of this PR since the changes need to be propagated to the rest of the code (e.g. section 6, lecture 81, start and end folders, as well as every other place where -> FileStorage is used.

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