Created
June 27, 2025 11:27
-
-
Save mypy-play/35b7dfd9e1ecb5e1dacfc3545a04e4ec 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 typing import Callable | |
class G[T]: | |
def g[S](self, x: S) -> S | T: ... | |
def f[T](x: Callable[[G[T]], int]) -> T: ... | |
def lambda_example[X](x: G[X]) -> X | int: | |
return x.g(0) | |
f(lambda_example) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment