Skip to content

Commit b7b98a6

Browse files
author
Kevin Kirsche
authored
curses: add Concatenate (#8414)
Update the `wrapper` `__func` parameter to use ParamSpec and Concatenate to address a todo.
1 parent 16e44d5 commit b7b98a6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

stdlib/curses/__init__.pyi

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
11
import sys
22
from collections.abc import Callable
3-
from typing import Any, TypeVar
3+
from typing import TypeVar
4+
from typing_extensions import Concatenate, ParamSpec
45

56
if sys.platform != "win32":
67
from _curses import *
78
from _curses import _CursesWindow as _CursesWindow
89

910
_T = TypeVar("_T")
11+
_P = ParamSpec("_P")
1012

1113
# available after calling `curses.initscr()`
1214
LINES: int
@@ -15,6 +17,5 @@ if sys.platform != "win32":
1517
# available after calling `curses.start_color()`
1618
COLORS: int
1719
COLOR_PAIRS: int
18-
# TODO: wait for `Concatenate` support
19-
# def wrapper(__func: Callable[Concatenate[_CursesWindow, _P], _T], *arg: _P.args, **kwds: _P.kwargs) -> _T: ...
20-
def wrapper(__func: Callable[..., _T], *arg: Any, **kwds: Any) -> _T: ...
20+
21+
def wrapper(__func: Callable[Concatenate[_CursesWindow, _P], _T], *arg: _P.args, **kwds: _P.kwargs) -> _T: ...

0 commit comments

Comments
 (0)