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

use Optional[] type hints #420

Merged
merged 1 commit into from
Jul 21, 2022
Merged

Conversation

atenni
Copy link
Contributor

@atenni atenni commented Jul 21, 2022

For arguments that have a default of None PEP-484 now recommends
using Optional[] (previously these optional types were assumed). It
also recommends type checkers move towards requiring the optional
type to be made explicit, so this commit will future proof for this
behaviour.

See: https://peps.python.org/pep-0484/#union-types

Closes: #419

For arguments that have a default of `None` PEP-484 now recommends
using `Optional[]` (previously these optional types were assumed). It
also recommends type checkers move towards requiring the optional
type to be made explicit, so this commit will future proof for this
behaviour.

See: https://peps.python.org/pep-0484/#union-types

Closes: SergeyPirogov#419
@pep8speaks
Copy link

Hello @atenni! Thanks for opening this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 17:80: E501 line too long (101 > 79 characters)
Line 18:80: E501 line too long (103 > 79 characters)

Line 19:80: E501 line too long (94 > 79 characters)
Line 20:80: E501 line too long (108 > 79 characters)
Line 47:80: E501 line too long (86 > 79 characters)

Line 18:9: E131 continuation line unaligned for hanging indent
Line 19:9: E131 continuation line unaligned for hanging indent

@SergeyPirogov
Copy link
Owner

@atenni thank you

@SergeyPirogov SergeyPirogov merged commit 16139d1 into SergeyPirogov:master Jul 21, 2022
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.

Type hints: Pyright complaining about arguments with default of None
3 participants