8000 Fixes to curses stubs (#6620) · python/typeshed@183a43a · GitHub
[go: up one dir, main page]

Skip to content

Commit 183a43a

Browse files
Fixes to curses stubs (#6620)
1 parent 6f2ff7e commit 183a43a

File tree

5 files changed

+15
-20
lines changed

5 files changed

+15
-20
lines changed

stdlib/_curses.pyi

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import sys
2-
from typing import IO, Any, BinaryIO, NamedTuple, Union, overload
2+
from _typeshed import SupportsRead
3+
from typing import IO, Any, NamedTuple, Union, overload
34

45
_chtype = Union[str, bytes, int]
56

@@ -293,9 +294,14 @@ def erasechar() -> bytes: ...
293294
def filter() -> None: ...
294295
def flash() -> None: ...
295296
def flushinp() -> None: ...
297+
298+
if sys.version_info >= (3, 9):
299+
def get_escdelay() -> int: ...
300+
def get_tabsize() -> int: ...
301+
296302
def getmouse() -> tuple[int, int, int, int, int]: ...
297303
def getsyx() -> tuple[int, int]: ...
298-
def getwin(__file: BinaryIO) -> _CursesWindow: ...
304+
def getwin(__file: SupportsRead[bytes]) -> _CursesWindow: ...
299305
def halfdelay(__tenths: int) -> None: ...
300306
def has_colors() -> bool: ...
301307

@@ -337,14 +343,19 @@ def resetty() -> None: ...
337343
def resize_term(__nlines: int, __ncols: int) -> None: ...
338344
def resizeterm(__nlines: int, __ncols: int) -> None: ...
339345
def savetty() -> None: ...
346+
347+
if sys.version_info >= (3, 9):
348+
def set_escdelay(__ms: int) -> None: ...
349+
def set_tabsize(__size: int) -> None: ...
350+
340351
def setsyx(__y: int, __x: int) -> None: ...
341352
def setupterm(term: str | None = ..., fd: int = ...) -> None: ...
342353
def start_color() -> None: ...
343354
def termattrs() -> int: ...
344355
def termname() -> bytes: ...
345356
def tigetflag(__capname: str) -> int: ...
346357
def tigetnum(__capname: str) -> int: ...
347-
def tigetstr(__capname: str) -> bytes: ...
358+
def tigetstr(__capname: str) -> bytes | None: ...
348359
def tparm(
349360
__str: bytes,
350361
__i1: int = ...,
@@ -362,7 +373,7 @@ def unctrl(__ch: _chtype) -> bytes: ...
362373
def unget_wch(__ch: int | str) -> None: ...
363374
def ungetch(__ch: _chtype) -> None: ...
364375
def ungetmouse(__id: int, __x: int, __y: int, __z: int, __bstate: int) -> None: ...
365-
def update_lines_cols() -> int: ...
376+
def update_lines_cols() -> None: ...
366377
def use_default_colors() -> None: ...
367378
def use_env(__flag: bool) -> None: ...
368379

tests/stubtest_allowlists/darwin-py310.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@ _curses.color_pair
33
curses.color_pair
44

55
# Exists at runtime, but missing from stubs
6-
_curses.get_escdelay
7-
_curses.get_tabsize
8-
_curses.set_escdelay
9-
_curses.set_tabsize
106
asyncio.PidfdChildWatcher
117
asyncio.unix_events.PidfdChildWatcher
128
os.CLD_KILLED

tests/stubtest_allowlists/darwin-py39.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,6 @@
11
_?curses.A_ITALIC
22

33
# Exists at runtime, but missing from stubs
4-
_curses.get_escdelay
5-
_curses.get_tabsize
6-
_curses.set_escdelay
7-
_curses.set_tabsize
84
asyncio.PidfdChildWatcher
95
asyncio.unix_events.PidfdChildWatcher
106
os.CLD_KILLED

tests/stubtest_allowlists/linux-py310.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ signal.sigwaitinfo
1818
select.epoll.register
1919

2020
# Exists at runtime, but missing from stubs
21-
_curses.get_escdelay
22-
_curses.get_tabsize
23-
_curses.set_escdelay
24-
_curses.set_tabsize
2521
asyncio.PidfdChildWatcher
2622
asyncio.unix_events.PidfdChildWatcher
2723
os.CLD_KILLED

tests/stubtest_allowlists/linux-py39.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,6 @@
22
select.epoll.register
33

44
# Exists at runtime, but missing from stubs
5-
_curses.get_escdelay
6-
_curses.get_tabsize
7-
_curses.set_escdelay
8-
_curses.set_tabsize
95
asyncio.PidfdChildWatcher
106
asyncio.unix_events.PidfdChildWatcher
117
os.CLD_KILLED

0 commit comments

Comments
 (0)
0