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 | instead of Union for union type annotations #216

Closed
dave-doty opened this issue Aug 2, 2022 · 0 comments
Closed

use | instead of Union for union type annotations #216

dave-doty opened this issue Aug 2, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@dave-doty
Copy link
Member

dave-doty commented Aug 2, 2022

This feature is officially in Python 3.10, but it can be used in previous versions with from __future__ import annotations. It's much easier to read.

In most places it will also be easier to read None | Type rather than Optional[Type].

@dave-doty dave-doty added the enhancement New feature or request label Aug 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant