Created
May 1, 2021 21:35
-
-
Save tomschr/4973136c509c8182026ca5405bde551b to your computer and use it in GitHub Desktop.
Typical type hints
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
# https://learning.oreilly.com/library/view/mastering-object-oriented-python/9781789531367/beafb66d-a1c5-444c-b22d-9ecf0d75e3f5.xhtml | |
from typing import Any, Callable, TypeVar, cast | |
FuncType = Callable[..., Any] | |
F = TypeVar('F', bound=FuncType) | |
def my_decorator(func: F) -> F: | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment