Created
August 7, 2022 03:43
-
-
Save nilsso/6a157c652c8139b181c17f97d8f7aa18 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
| import typing | |
| T = typing.TypeVar("T") | |
| def not_none(v: T | None) -> T: | |
| assert v is not None | |
| return v | |
| def foo() -> int | None: | |
| return 1 | |
| a = not_none(foo()) # pyright shows "int" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment