Created
June 13, 2025 07:17
-
-
Save mypy-play/0014b772c0ced71a232b6fc68c343e62 to your computer and use it in GitHub Desktop.
Shared via mypy Playground
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
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