mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-17 07:20:53 +07:00
Support type hints and type checking for typing.ParamSpec and typing.Concatenate (cherry picked from commit 7854b3386ccdffc0091664e0923622cd8c093fc9) IJ-MR-12970 GitOrigin-RevId: 4578cb463b6ab8fc244766bfaccb122d0e2b7479
19 lines
394 B
Python
19 lines
394 B
Python
from typing import TypeVar, Generic, Callable, ParamSpec, Concatenate
|
|
|
|
U = TypeVar("U")
|
|
P = ParamSpec("P")
|
|
|
|
|
|
class Y(Generic[U, P]):
|
|
f: Callable[Concatenate[int, P], U]
|
|
attr: U
|
|
|
|
def __i<the_ref>nit__(self, f: Callable[Concatenate[int, P], U], attr: U) -> None:
|
|
self.f = f
|
|
self.attr = attr
|
|
|
|
|
|
def a(q: int, s: str, b: bool) -> str: ...
|
|
|
|
|
|
expr = Y(a, '1').f(42, "42" , True) |