Skip to content

Instantly share code, notes, and snippets.

@mypy-play
Created June 13, 2025 07:17
Show Gist options
  • Save mypy-play/0014b772c0ced71a232b6fc68c343e62 to your computer and use it in GitHub Desktop.
Save mypy-play/0014b772c0ced71a232b6fc68c343e62 to your computer and use it in GitHub Desktop.
Shared via mypy Playground
from collections.abc import Callable
def typed[**P, T](f: Callable[P, T]) -> Callable[P, T]:
return f
def untyped(f):
return f
def foo(a: int, b: str) -> bool:
return bool(a) and bool(b)
reveal_type(typed(foo))
reveal_type(untyped(foo))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment