Skip to content

Instantly share code, notes, and snippets.

@tomschr
Created May 1, 2021 21:35
Show Gist options
  • Save tomschr/4973136c509c8182026ca5405bde551b to your computer and use it in GitHub Desktop.
Save tomschr/4973136c509c8182026ca5405bde551b to your computer and use it in GitHub Desktop.
Typical type hints
# 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