mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 21:46:42 +08:00
Relate _curses.wrapper return type to its function arg (#2353)
`curses.wrapper` returns the return value of the function it is passed, but its function argument is declared as `Callable[..., Any]` while its return type is `None`. This changes the definition of `curses.wrapper` to use a `TypeVar` that relates the return type of its function argument to its own return type.
This commit is contained in:
committed by
Jelle Zijlstra
parent
8b5d4708a0
commit
4ca0a63027
@@ -1,10 +1,12 @@
|
||||
import _curses
|
||||
from _curses import * # noqa: F403
|
||||
from typing import Callable, Any, Sequence, Mapping
|
||||
from typing import TypeVar, Callable, Any, Sequence, Mapping
|
||||
|
||||
_T = TypeVar('_T')
|
||||
|
||||
LINES: int
|
||||
COLS: int
|
||||
|
||||
def initscr() -> _curses._CursesWindow: ...
|
||||
def start_color() -> None: ...
|
||||
def wrapper(func: Callable[..., Any], *arg: Any, **kwds: Any) -> None: ...
|
||||
def wrapper(func: Callable[..., _T], *arg: Any, **kwds: Any) -> _T: ...
|
||||
|
||||
Reference in New Issue
Block a user