Created
October 2, 2021 10:07
-
-
Save MartinThoma/177df42a9ed7dbef4433b0d22e5d99d9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Before 3.10 | |
from typing import Union | |
def foo() -> Union[float, str]: ... | |
isinstance(bar (float, int)) | |
# With 3.10 | |
def foo(a: int) -> float | str: ... | |
isinstance(bar, float | int) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment