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

typing: use Optional[T] instead of T | None for Python 3.9 compatibility #261

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

jnikula
Copy link
Owner

@jnikula jnikula commented Sep 28, 2024

Although Python 3.9 supports built-in type hinting instead of having to import from typing, unfortunately the T | None syntax was only introduced in Python 3.10.

Use Optional[T] instead for Python 3.9 compatibility.

Although Python 3.9 supports built-in type hinting instead of having to
import from typing, unfortunately the T | None syntax was only
introduced in Python 3.10.

Use Optional[T] instead for Python 3.9 compatibility.
Copy link
Collaborator

@BrunoMSantos BrunoMSantos left a comment

Choose a reason for hiding this comment

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

Too bad :/
Looks good in the meantime though.

@jnikula jnikula merged commit 5ec432a into master Sep 30, 2024
6 checks passed
@jnikula jnikula deleted the typing-fix branch September 30, 2024 09:09
@jnikula
Copy link
Owner Author

jnikula commented Sep 30, 2024

Too bad :/ Looks good in the meantime though.

Yeah, it's a bit sad. But good thing I caught this before doing the next release!

Thanks, merged.

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