-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
bugmypy got something wrongmypy got something wrongtopic-paramspecPEP 612, ParamSpec, ConcatenatePEP 612, ParamSpec, Concatenate
Description
from typing import Callable, TypeVar
R = TypeVar('R')
Carry = TypeVar('Carry')
X = TypeVar('X')
Y = TypeVar('Y')
def api_boundary(f: Callable[..., R]) -> Callable[..., R]:
return f
@api_boundary # Removing this decorator fixes things.
def scan(f: Callable[[Carry, X], tuple[Carry, Y]],
init: Carry,
xs: X) -> tuple[Carry, Y]:
...
def f(c: int, x: bool) -> tuple[int, float]:
return (c, 1.0)
reveal_type(scan(f, 1, True)) # Tuple[Carry`-1, Y`-3]
This is on Mypy 0.921.
Or maybe I've misunderstood type inference, and just have to wait for PEP 612 to finish being implemented?
Metadata
Metadata
Assignees
Labels
bugmypy got something wrongmypy got something wrongtopic-paramspecPEP 612, ParamSpec, ConcatenatePEP 612, ParamSpec, Concatenate