Created
May 3, 2020 18:19
-
-
Save koi8-r/0233b936d09fce4497d20db87ff16bd4 to your computer and use it in GitHub Desktop.
Python MyPy cheats
This file contains 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
from typing import Any, TypeVar, Callable, IO, Match | |
import re, sys | |
F = TypeVar('F', bound=Callable[..., Any]) | |
def decorator(fn: F) -> F: | |
... | |
def stdout() -> IO[str]: | |
return sys.stdout | |
match: Match[str] = re.match(r'.*', '1234') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment