Skip to content

Conversation

@bact
Copy link
Contributor

@bact bact commented Jan 16, 2026

PEP 484 prohibits implicit Optional.
https://peps.python.org/pep-0484/#union-types

This PR updates type hints from:

def f(document: Document = None) -> Any:

to

def f(document: Document | None = None) -> Any:

Note that this mass conversion is done automatically by https://github.com/hauntsaninja/no_implicit_optional as suggested by mypy, with a human review.

Uses ... | None style instead of Optional[...] since we are now using Python 3.10.

bact added 2 commits January 16, 2026 09:53
PEP 484 prohibits implicit Optional.

Note that this mass conversion is done automatically by https://github.com/hauntsaninja/no_implicit_optional as suggested by mypy, with a human review.

Uses `... | None` style instead of `Optional[...]` since we are now using Python 3.10.

Signed-off-by: Arthit Suriyawongkul <[email protected]>
Signed-off-by: Arthit Suriyawongkul <[email protected]>
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.

1 participant