Skip to content

Commit 5161ac2

Browse files
github-actions[bot]hauntsaninjaAlexWaygood
authoredApr 15, 2024··
Sync typeshed (#17124)
Source commit: python/typeshed@7c8e82f Co-authored-by: mypybot <> Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com> Co-authored-by: AlexWaygood <alex.waygood@gmail.com>
1 parent e2fc1f2 commit 5161ac2

17 files changed

+795
-730
lines changed
 

‎mypy/typeshed/stdlib/_curses.pyi

+549-542
Large diffs are not rendered by default.

‎mypy/typeshed/stdlib/asyncio/streams.pyi

+10-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import ssl
22
import sys
3-
from _typeshed import StrPath
4-
from collections.abc import AsyncIterator, Awaitable, Callable, Iterable, Sequence
5-
from typing import Any, SupportsIndex
3+
from _typeshed import ReadableBuffer, StrPath
4+
from collections.abc import AsyncIterator, Awaitable, Callable, Iterable, Sequence, Sized
5+
from typing import Any, Protocol, SupportsIndex
66
from typing_extensions import Self, TypeAlias
77

88
from . import events, protocols, transports
@@ -23,6 +23,8 @@ else:
2323

2424
_ClientConnectedCallback: TypeAlias = Callable[[StreamReader, StreamWriter], Awaitable[None] | None]
2525

26+
class _ReaduntilBuffer(ReadableBuffer, Sized, Protocol): ...
27+
2628
if sys.version_info >= (3, 10):
2729
async def open_connection(
2830
host: str | None = None,
@@ -140,8 +142,11 @@ class StreamReader(AsyncIterator[bytes]):
140142
def at_eof(self) -> bool: ...
141143
def feed_data(self, data: Iterable[SupportsIndex]) -> None: ...
142144
async def readline(self) -> bytes: ...
143-
# Can be any buffer that supports len(); consider changing to a Protocol if PEP 688 is accepted
144-
async def readuntil(self, separator: bytes | bytearray | memoryview = b"\n") -> bytes: ...
145+
if sys.version_info >= (3, 13):
146+
async def readuntil(self, separator: _ReaduntilBuffer | tuple[_ReaduntilBuffer, ...] = b"\n") -> bytes: ...
147+
else:
148+
async def readuntil(self, separator: _ReaduntilBuffer = b"\n") -> bytes: ...
149+
145150
async def read(self, n: int = -1) -> bytes: ...
146151
async def readexactly(self, n: int) -> bytes: ...
147152
def __aiter__(self) -> Self: ...
+14-13
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
1-
import sys
1+
from _curses import *
2+
from _curses import _CursesWindow as _CursesWindow
23
from collections.abc import Callable
34
from typing import TypeVar
45
from typing_extensions import Concatenate, ParamSpec
56

6-
if sys.platform != "win32":
7-
from _curses import *
8-
from _curses import _CursesWindow as _CursesWindow
7+
# NOTE: The _curses module is ordinarily only available on Unix, but the
8+
# windows-curses package makes it available on Windows as well with the same
9+
# contents.
910

10-
_T = TypeVar("_T")
11-
_P = ParamSpec("_P")
11+
_T = TypeVar("_T")
12+
_P = ParamSpec("_P")
1213

13-
# available after calling `curses.initscr()`
14-
LINES: int
15-
COLS: int
14+
# available after calling `curses.initscr()`
15+
LINES: int
16+
COLS: int
1617

17-
# available after calling `curses.start_color()`
18-
COLORS: int
19-
COLOR_PAIRS: int
18+
# available after calling `curses.start_color()`
19+
COLORS: int
20+
COLOR_PAIRS: int
2021

21-
def wrapper(func: Callable[Concatenate[_CursesWindow, _P], _T], /, *arg: _P.args, **kwds: _P.kwargs) -> _T: ...
22+
def wrapper(func: Callable[Concatenate[_CursesWindow, _P], _T], /, *arg: _P.args, **kwds: _P.kwargs) -> _T: ...

‎mypy/typeshed/stdlib/curses/ascii.pyi

+58-59
Original file line numberDiff line numberDiff line change
@@ -1,63 +1,62 @@
1-
import sys
21
from typing import TypeVar
32

4-
if sys.platform != "win32":
5-
_CharT = TypeVar("_CharT", str, int)
3+
_CharT = TypeVar("_CharT", str, int)
64

7-
NUL: int
8-
SOH: int
9-
STX: int
10-
ETX: int
11-
EOT: int
12-
ENQ: int
13-
ACK: int
14-
BEL: int
15-
BS: int
16-
TAB: int
17-
HT: int
18-
LF: int
19-
NL: int
20-
VT: int
21-
FF: int
22-
CR: int
23-
SO: int
24-
SI: int
25-
DLE: int
26-
DC1: int
27-
DC2: int
28-
DC3: int
29-
DC4: int
30-
NAK: int
31-
SYN: int
32-
ETB: int
33-
CAN: int
34-
EM: int
35-
SUB: int
36-
ESC: int
37-
FS: int
38-
GS: int
39-
RS: int
40-
US: int
41-
SP: int
42-
DEL: int
5+
NUL: int
6+
SOH: int
7+
STX: int
8+
ETX: int
9+
EOT: int
10+
ENQ: int
11+
ACK: int
12+
BEL: int
13+
BS: int
14+
TAB: int
15+
HT: int
16+
LF: int
17+
NL: int
18+
VT: int
19+
FF: int
20+
CR: int
21+
SO: int
22+
SI: int
23+
DLE: int
24+
DC1: int
25+
DC2: int
26+
DC3: int
27+
DC4: int
28+
NAK: int
29+
SYN: int
30+
ETB: int
31+
CAN: int
32+
EM: int
33+
SUB: int
34+
ESC: int
35+
FS: int
36+
GS: int
37+
RS: int
38+
US: int
39+
SP: int
40+
DEL: int
4341

44-
controlnames: list[int]
45-
def isalnum(c: str | int) -> bool: ...
46-
def isalpha(c: str | int) -> bool: ...
47-
def isascii(c: str | int) -> bool: ...
48-
def isblank(c: str | int) -> bool: ...
49-
def iscntrl(c: str | int) -> bool: ...
50-
def isdigit(c: str | int) -> bool: ...
51-
def isgraph(c: str | int) -> bool: ...
52-
def islower(c: str | int) -> bool: ...
53-
def isprint(c: str | int) -> bool: ...
54-
def ispunct(c: str | int) -> bool: ...
55-
def isspace(c: str | int) -> bool: ...
56-
def isupper(c: str | int) -> bool: ...
57-
def isxdigit(c: str | int) -> bool: ...
58-
def isctrl(c: str | int) -> bool: ...
59-
def ismeta(c: str | int) -> bool: ...
60-
def ascii(c: _CharT) -> _CharT: ...
61-
def ctrl(c: _CharT) -> _CharT: ...
62-
def alt(c: _CharT) -> _CharT: ...
63-
def unctrl(c: str | int) -> str: ...
42+
controlnames: list[int]
43+
44+
def isalnum(c: str | int) -> bool: ...
45+
def isalpha(c: str | int) -> bool: ...
46+
def isascii(c: str | int) -> bool: ...
47+
def isblank(c: str | int) -> bool: ...
48+
def iscntrl(c: str | int) -> bool: ...
49+
def isdigit(c: str | int) -> bool: ...
50+
def isgraph(c: str | int) -> bool: ...
51+
def islower(c: str | int) -> bool: ...
52+
def isprint(c: str | int) -> bool: ...
53+
def ispunct(c: str | int) -> bool: ...
54+
def isspace(c: str | int) -> bool: ...
55+
def isupper(c: str | int) -> bool: ...
56+
def isxdigit(c: str | int) -> bool: ...
57+
def isctrl(c: str | int) -> bool: ...
58+
def ismeta(c: str | int) -> bool: ...
59+
def ascii(c: _CharT) -> _CharT: ...
60+
def ctrl(c: _CharT) -> _CharT: ...
61+
def alt(c: _CharT) -> _CharT: ...
62+
def unctrl(c: str | int) -> str: ...
+1-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
import sys
2-
3-
if sys.platform != "win32":
4-
def has_key(ch: int | str) -> bool: ...
1+
def has_key(ch: int | str) -> bool: ...

‎mypy/typeshed/stdlib/curses/panel.pyi

+19-22
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,22 @@
1-
import sys
1+
from _curses import _CursesWindow
22

3-
if sys.platform != "win32":
4-
from _curses import _CursesWindow
3+
version: str
54

6-
version: str
5+
class _Curses_Panel: # type is <class '_curses_panel.curses panel'> (note the space in the class name)
6+
def above(self) -> _Curses_Panel: ...
7+
def below(self) -> _Curses_Panel: ...
8+
def bottom(self) -> None: ...
9+
def hidden(self) -> bool: ...
10+
def hide(self) -> None: ...
11+
def move(self, y: int, x: int) -> None: ...
12+
def replace(self, win: _CursesWindow) -> None: ...
13+
def set_userptr(self, obj: object) -> None: ...
14+
def show(self) -> None: ...
15+
def top(self) -> None: ...
16+
def userptr(self) -> object: ...
17+
def window(self) -> _CursesWindow: ...
718

8-
class _Curses_Panel: # type is <class '_curses_panel.curses panel'> (note the space in the class name)
9-
def above(self) -> _Curses_Panel: ...
10-
def below(self) -> _Curses_Panel: ...
11-
def bottom(self) -> None: ...
12-
def hidden(self) -> bool: ...
13-
def hide(self) -> None: ...
14-
def move(self, y: int, x: int) -> None: ...
15-
def replace(self, win: _CursesWindow) -> None: ...
16-
def set_userptr(self, obj: object) -> None: ...
17-
def show(self) -> None: ...
18-
def top(self) -> None: ...
19-
def userptr(self) -> object: ...
20-
def window(self) -> _CursesWindow: ...
21-
22-
def bottom_panel() -> _Curses_Panel: ...
23-
def new_panel(win: _CursesWindow, /) -> _Curses_Panel: ...
24-
def top_panel() -> _Curses_Panel: ...
25-
def update_panels() -> _Curses_Panel: ...
19+
def bottom_panel() -> _Curses_Panel: ...
20+
def new_panel(win: _CursesWindow, /) -> _Curses_Panel: ...
21+
def top_panel() -> _Curses_Panel: ...
22+
def update_panels() -> _Curses_Panel: ...
+8-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
1-
import sys
1+
from _curses import _CursesWindow
22
from collections.abc import Callable
33

4-
if sys.platform != "win32":
5-
from _curses import _CursesWindow
6-
def rectangle(win: _CursesWindow, uly: int, ulx: int, lry: int, lrx: int) -> None: ...
4+
def rectangle(win: _CursesWindow, uly: int, ulx: int, lry: int, lrx: int) -> None: ...
75

8-
class Textbox:
9-
stripspaces: bool
10-
def __init__(self, win: _CursesWindow, insert_mode: bool = False) -> None: ...
11-
def edit(self, validate: Callable[[int], int] | None = None) -> str: ...
12-
def do_command(self, ch: str | int) -> None: ...
13-
def gather(self) -> str: ...
6+
class Textbox:
7+
stripspaces: bool
8+
def __init__(self, win: _CursesWindow, insert_mode: bool = False) -> None: ...
9+
def edit(self, validate: Callable[[int], int] | None = None) -> str: ...
10+
def do_command(self, ch: str | int) -> None: ...
11+
def gather(self) -> str: ...

‎mypy/typeshed/stdlib/importlib/resources/simple.pyi

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import abc
22
import sys
3-
from _typeshed import Incomplete, OpenBinaryMode, OpenTextMode, Unused
43
from collections.abc import Iterator
54
from io import TextIOWrapper
65
from typing import IO, Any, BinaryIO, Literal, NoReturn, overload
@@ -28,11 +27,19 @@ if sys.version_info >= (3, 11):
2827
def is_file(self) -> Literal[True]: ...
2928
def is_dir(self) -> Literal[False]: ...
3029
@overload
31-
def open(self, mode: OpenTextMode = "r", *args, **kwargs) -> TextIOWrapper: ...
30+
def open(
31+
self,
32+
mode: Literal["r"] = "r",
33+
encoding: str | None = None,
34+
errors: str | None = None,
35+
newline: str | None = None,
36+
line_buffering: bool = False,
37+
write_through: bool = False,
38+
) -> TextIOWrapper: ...
3239
@overload
33-
def open(self, mode: OpenBinaryMode, *args: Unused, **kwargs: Unused) -> BinaryIO: ...
40+
def open(self, mode: Literal["rb"]) -> BinaryIO: ...
3441
@overload
35-
def open(self, mode: str, *args: Incomplete, **kwargs) -> IO[Any]: ...
42+
def open(self, mode: str) -> IO[Any]: ...
3643
def joinpath(self, name: Never) -> NoReturn: ... # type: ignore[override]
3744

3845
class ResourceContainer(Traversable, metaclass=abc.ABCMeta):

‎mypy/typeshed/stdlib/io.pyi

+5-5
Original file line numberDiff line numberDiff line change
@@ -179,11 +179,11 @@ class TextIOWrapper(TextIOBase, TextIO): # type: ignore[misc] # incompatible d
179179
def __init__(
180180
self,
181181
buffer: _WrappedBuffer,
182-
encoding: str | None = ...,
183-
errors: str | None = ...,
184-
newline: str | None = ...,
185-
line_buffering: bool = ...,
186-
write_through: bool = ...,
182+
encoding: str | None = None,
183+
errors: str | None = None,
184+
newline: str | None = None,
185+
line_buffering: bool = False,
186+
write_through: bool = False,
187187
) -> None: ...
188188
# Equals the "buffer" argument passed in to the constructor.
189189
@property

‎mypy/typeshed/stdlib/multiprocessing/resource_tracker.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ __all__ = ["ensure_running", "register", "unregister"]
66
class ResourceTracker:
77
def getfd(self) -> int | None: ...
88
def ensure_running(self) -> None: ...
9-
def register(self, name: Sized, rtype) -> None: ...
10-
def unregister(self, name: Sized, rtype) -> None: ...
9+
def register(self, name: Sized, rtype: str) -> None: ...
10+
def unregister(self, name: Sized, rtype: str) -> None: ...
1111

1212
_resource_tracker: ResourceTracker
1313
ensure_running = _resource_tracker.ensure_running

‎mypy/typeshed/stdlib/multiprocessing/util.pyi

+25-6
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import threading
22
from _typeshed import ConvertibleToInt, Incomplete, Unused
33
from collections.abc import Callable, Iterable, Mapping, MutableMapping, Sequence
44
from logging import Logger, _Level as _LoggingLevel
5-
from typing import Any
5+
from typing import Any, Generic, TypeVar, overload
66

77
__all__ = [
88
"sub_debug",
@@ -22,6 +22,9 @@ __all__ = [
2222
"SUBWARNING",
2323
]
2424

25+
_T = TypeVar("_T")
26+
_R_co = TypeVar("_R_co", default=Any, covariant=True)
27+
2528
NOTSET: int
2629
SUBDEBUG: int
2730
DEBUG: int
@@ -42,13 +45,29 @@ def is_abstract_socket_namespace(address: str | bytes | None) -> bool: ...
4245
abstract_sockets_supported: bool
4346

4447
def get_temp_dir() -> str: ...
45-
def register_after_fork(obj, func: Callable[[Incomplete], object]) -> None: ...
48+
def register_after_fork(obj: _T, func: Callable[[_T], object]) -> None: ...
4649

47-
class Finalize:
50+
class Finalize(Generic[_R_co]):
51+
# "args" and "kwargs" are passed as arguments to "callback".
52+
@overload
53+
def __init__(
54+
self,
55+
obj: None,
56+
callback: Callable[..., _R_co],
57+
*,
58+
args: Sequence[Any] = (),
59+
kwargs: Mapping[str, Any] | None = None,
60+
exitpriority: int,
61+
) -> None: ...
62+
@overload
63+
def __init__(
64+
self, obj: None, callback: Callable[..., _R_co], args: Sequence[Any], kwargs: Mapping[str, Any] | None, exitpriority: int
65+
) -> None: ...
66+
@overload
4867
def __init__(
4968
self,
50-
obj: Incomplete | None,
51-
callback: Callable[..., Incomplete],
69+
obj: Any,
70+
callback: Callable[..., _R_co],
5271
args: Sequence[Any] = (),
5372
kwargs: Mapping[str, Any] | None = None,
5473
exitpriority: int | None = None,
@@ -59,7 +78,7 @@ class Finalize:
5978
_finalizer_registry: MutableMapping[Incomplete, Incomplete] = {},
6079
sub_debug: Callable[..., object] = ...,
6180
getpid: Callable[[], int] = ...,
62-
): ...
81+
) -> _R_co: ...
6382
def cancel(self) -> None: ...
6483
def still_active(self) -> bool: ...
6584

‎mypy/typeshed/stdlib/ssl.pyi

+6
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,9 @@ class SSLSocket(socket.socket):
366366
def recvmsg(self, *args: Never, **kwargs: Never) -> Never: ... # type: ignore[override]
367367
def recvmsg_into(self, *args: Never, **kwargs: Never) -> Never: ... # type: ignore[override]
368368
def sendmsg(self, *args: Never, **kwargs: Never) -> Never: ... # type: ignore[override]
369+
if sys.version_info >= (3, 13):
370+
def get_verified_chain(self) -> list[bytes]: ...
371+
def get_unverified_chain(self) -> list[bytes]: ...
369372

370373
class TLSVersion(enum.IntEnum):
371374
MINIMUM_SUPPORTED: int
@@ -476,6 +479,9 @@ class SSLObject:
476479
def version(self) -> str | None: ...
477480
def get_channel_binding(self, cb_type: str = "tls-unique") -> bytes | None: ...
478481
def verify_client_post_handshake(self) -> None: ...
482+
if sys.version_info >= (3, 13):
483+
def get_verified_chain(self) -> list[bytes]: ...
484+
def get_unverified_chain(self) -> list[bytes]: ...
479485

480486
@final
481487
class MemoryBIO:

‎mypy/typeshed/stdlib/typing.pyi

+5-5
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class TypeVar:
170170
def __or__(self, right: Any) -> _SpecialForm: ...
171171
def __ror__(self, left: Any) -> _SpecialForm: ...
172172
if sys.version_info >= (3, 11):
173-
def __typing_subst__(self, arg): ...
173+
def __typing_subst__(self, arg: Any) -> Any: ...
174174

175175
# Used for an undocumented mypy feature. Does not exist at runtime.
176176
_promote = object()
@@ -221,7 +221,7 @@ if sys.version_info >= (3, 11):
221221
def __init__(self, name: str) -> None: ...
222222
def __iter__(self) -> Any: ...
223223
def __typing_subst__(self, arg: Never) -> Never: ...
224-
def __typing_prepare_subst__(self, alias, args): ...
224+
def __typing_prepare_subst__(self, alias: Any, args: Any) -> tuple[Any, ...]: ...
225225

226226
if sys.version_info >= (3, 10):
227227
@final
@@ -270,8 +270,8 @@ if sys.version_info >= (3, 10):
270270
@property
271271
def kwargs(self) -> ParamSpecKwargs: ...
272272
if sys.version_info >= (3, 11):
273-
def __typing_subst__(self, arg): ...
274-
def __typing_prepare_subst__(self, alias, args): ...
273+
def __typing_subst__(self, arg: Any) -> Any: ...
274+
def __typing_prepare_subst__(self, alias: Any, args: Any) -> tuple[Any, ...]: ...
275275

276276
def __or__(self, right: Any) -> _SpecialForm: ...
277277
def __ror__(self, left: Any) -> _SpecialForm: ...
@@ -290,7 +290,7 @@ if sys.version_info >= (3, 10):
290290

291291
def __or__(self, other: Any) -> _SpecialForm: ...
292292
def __ror__(self, other: Any) -> _SpecialForm: ...
293-
__supertype__: type
293+
__supertype__: type | NewType
294294

295295
else:
296296
def NewType(name: str, tp: Any) -> Any: ...

‎mypy/typeshed/stdlib/typing_extensions.pyi

+4-4
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ else:
374374
class NewType:
375375
def __init__(self, name: str, tp: Any) -> None: ...
376376
def __call__(self, obj: _T, /) -> _T: ...
377-
__supertype__: type
377+
__supertype__: type | NewType
378378
if sys.version_info >= (3, 10):
379379
def __or__(self, other: Any) -> _SpecialForm: ...
380380
def __ror__(self, other: Any) -> _SpecialForm: ...
@@ -413,7 +413,7 @@ class TypeVar:
413413
def __or__(self, right: Any) -> _SpecialForm: ...
414414
def __ror__(self, left: Any) -> _SpecialForm: ...
415415
if sys.version_info >= (3, 11):
416-
def __typing_subst__(self, arg): ...
416+
def __typing_subst__(self, arg: Any) -> Any: ...
417417

418418
@final
419419
class ParamSpec:
@@ -453,10 +453,10 @@ class TypeVarTuple:
453453
def __iter__(self) -> Any: ... # Unpack[Self]
454454

455455
class deprecated:
456-
message: str
456+
message: LiteralString
457457
category: type[Warning] | None
458458
stacklevel: int
459-
def __init__(self, message: str, /, *, category: type[Warning] | None = ..., stacklevel: int = 1) -> None: ...
459+
def __init__(self, message: LiteralString, /, *, category: type[Warning] | None = ..., stacklevel: int = 1) -> None: ...
460460
def __call__(self, arg: _T, /) -> _T: ...
461461

462462
if sys.version_info >= (3, 12):

‎mypy/typeshed/stdlib/winreg.pyi

+75-46
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import sys
2+
from _typeshed import ReadableBuffer, Unused
23
from types import TracebackType
3-
from typing import Any, Literal, final
4+
from typing import Any, Final, Literal, final, overload
45
from typing_extensions import Self, TypeAlias
56

67
if sys.platform == "win32":
@@ -24,12 +25,40 @@ if sys.platform == "win32":
2425
def QueryValueEx(key: _KeyType, name: str, /) -> tuple[Any, int]: ...
2526
def SaveKey(key: _KeyType, file_name: str, /) -> None: ...
2627
def SetValue(key: _KeyType, sub_key: str, type: int, value: str, /) -> None: ...
28+
@overload # type=REG_DWORD|REG_QWORD
2729
def SetValueEx(
28-
key: _KeyType, value_name: str | None, reserved: Any, type: int, value: str | int, /
29-
) -> None: ... # reserved is ignored
30+
key: _KeyType, value_name: str | None, reserved: Unused, type: Literal[4, 5], value: int | None, /
31+
) -> None: ...
32+
@overload # type=REG_SZ|REG_EXPAND_SZ
33+
def SetValueEx(
34+
key: _KeyType, value_name: str | None, reserved: Unused, type: Literal[1, 2], value: str | None, /
35+
) -> None: ...
36+
@overload # type=REG_MULTI_SZ
37+
def SetValueEx(
38+
key: _KeyType, value_name: str | None, reserved: Unused, type: Literal[7], value: list[str] | None, /
39+
) -> None: ...
40+
@overload # type=REG_BINARY and everything else
41+
def SetValueEx(
42+
key: _KeyType,
43+
value_name: str | None,
44+
reserved: Unused,
45+
type: Literal[0, 3, 8, 9, 10, 11],
46+
value: ReadableBuffer | None,
47+
/,
48+
) -> None: ...
49+
@overload # Unknown or undocumented
50+
def SetValueEx(
51+
key: _KeyType,
52+
value_name: str | None,
53+
reserved: Unused,
54+
type: int,
55+
value: int | str | list[str] | ReadableBuffer | None,
56+
/,
57+
) -> None: ...
3058
def DisableReflectionKey(key: _KeyType, /) -> None: ...
3159
def EnableReflectionKey(key: _KeyType, /) -> None: ...
3260
def QueryReflectionKey(key: _KeyType, /) -> bool: ...
61+
3362
HKEY_CLASSES_ROOT: int
3463
HKEY_CURRENT_USER: int
3564
HKEY_LOCAL_MACHINE: int
@@ -38,52 +67,52 @@ if sys.platform == "win32":
3867
HKEY_CURRENT_CONFIG: int
3968
HKEY_DYN_DATA: int
4069

41-
KEY_ALL_ACCESS: Literal[983103]
42-
KEY_WRITE: Literal[131078]
43-
KEY_READ: Literal[131097]
44-
KEY_EXECUTE: Literal[131097]
45-
KEY_QUERY_VALUE: Literal[1]
46-
KEY_SET_VALUE: Literal[2]
47-
KEY_CREATE_SUB_KEY: Literal[4]
48-
KEY_ENUMERATE_SUB_KEYS: Literal[8]
49-
KEY_NOTIFY: Literal[16]
50-
KEY_CREATE_LINK: Literal[32]
70+
KEY_ALL_ACCESS: Final = 983103
71+
KEY_WRITE: Final = 131078
72+
KEY_READ: Final = 131097
73+
KEY_EXECUTE: Final = 131097
74+
KEY_QUERY_VALUE: Final = 1
75+
KEY_SET_VALUE: Final = 2
76+
KEY_CREATE_SUB_KEY: Final = 4
77+
KEY_ENUMERATE_SUB_KEYS: Final = 8
78+
KEY_NOTIFY: Final = 16
79+
KEY_CREATE_LINK: Final = 32
5180

52-
KEY_WOW64_64KEY: Literal[256]
53-
KEY_WOW64_32KEY: Literal[512]
81+
KEY_WOW64_64KEY: Final = 256
82+
KEY_WOW64_32KEY: Final = 512
5483

55-
REG_BINARY: Literal[3]
56-
REG_DWORD: Literal[4]
57-
REG_DWORD_LITTLE_ENDIAN: Literal[4]
58-
REG_DWORD_BIG_ENDIAN: Literal[5]
59-
REG_EXPAND_SZ: Literal[2]
60-
REG_LINK: Literal[6]
61-
REG_MULTI_SZ: Literal[7]
62-
REG_NONE: Literal[0]
63-
REG_QWORD: Literal[11]
64-
REG_QWORD_LITTLE_ENDIAN: Literal[11]
65-
REG_RESOURCE_LIST: Literal[8]
66-
REG_FULL_RESOURCE_DESCRIPTOR: Literal[9]
67-
REG_RESOURCE_REQUIREMENTS_LIST: Literal[10]
68-
REG_SZ: Literal[1]
84+
REG_BINARY: Final = 3
85+
REG_DWORD: Final = 4
86+
REG_DWORD_LITTLE_ENDIAN: Final = 4
87+
REG_DWORD_BIG_ENDIAN: Final = 5
88+
REG_EXPAND_SZ: Final = 2
89+
REG_LINK: Final = 6
90+
REG_MULTI_SZ: Final = 7
91+
REG_NONE: Final = 0
92+
REG_QWORD: Final = 11
93+
REG_QWORD_LITTLE_ENDIAN: Final = 11
94+
REG_RESOURCE_LIST: Final = 8
95+
REG_FULL_RESOURCE_DESCRIPTOR: Final = 9
96+
REG_RESOURCE_REQUIREMENTS_LIST: Final = 10
97+
REG_SZ: Final = 1
6998

70-
REG_CREATED_NEW_KEY: int # undocumented
71-
REG_LEGAL_CHANGE_FILTER: int # undocumented
72-
REG_LEGAL_OPTION: int # undocumented
73-
REG_NOTIFY_CHANGE_ATTRIBUTES: int # undocumented
74-
REG_NOTIFY_CHANGE_LAST_SET: int # undocumented
75-
REG_NOTIFY_CHANGE_NAME: int # undocumented
76-
REG_NOTIFY_CHANGE_SECURITY: int # undocumented
77-
REG_NO_LAZY_FLUSH: int # undocumented
78-
REG_OPENED_EXISTING_KEY: int # undocumented
79-
REG_OPTION_BACKUP_RESTORE: int # undocumented
80-
REG_OPTION_CREATE_LINK: int # undocumented
81-
REG_OPTION_NON_VOLATILE: int # undocumented
82-
REG_OPTION_OPEN_LINK: int # undocumented
83-
REG_OPTION_RESERVED: int # undocumented
84-
REG_OPTION_VOLATILE: int # undocumented
85-
REG_REFRESH_HIVE: int # undocumented
86-
REG_WHOLE_HIVE_VOLATILE: int # undocumented
99+
REG_CREATED_NEW_KEY: Final = 1 # undocumented
100+
REG_LEGAL_CHANGE_FILTER: Final = 268435471 # undocumented
101+
REG_LEGAL_OPTION: Final = 31 # undocumented
102+
REG_NOTIFY_CHANGE_ATTRIBUTES: Final = 2 # undocumented
103+
REG_NOTIFY_CHANGE_LAST_SET: Final = 4 # undocumented
104+
REG_NOTIFY_CHANGE_NAME: Final = 1 # undocumented
105+
REG_NOTIFY_CHANGE_SECURITY: Final = 8 # undocumented
106+
REG_NO_LAZY_FLUSH: Final = 4 # undocumented
107+
REG_OPENED_EXISTING_KEY: Final = 2 # undocumented
108+
REG_OPTION_BACKUP_RESTORE: Final = 4 # undocumented
109+
REG_OPTION_CREATE_LINK: Final = 2 # undocumented
110+
REG_OPTION_NON_VOLATILE: Final = 0 # undocumented
111+
REG_OPTION_OPEN_LINK: Final = 8 # undocumented
112+
REG_OPTION_RESERVED: Final = 0 # undocumented
113+
REG_OPTION_VOLATILE: Final = 1 # undocumented
114+
REG_REFRESH_HIVE: Final = 2 # undocumented
115+
REG_WHOLE_HIVE_VOLATILE: Final = 1 # undocumented
87116

88117
error = OSError
89118

‎mypy/typeshed/stdlib/xml/dom/minidom.pyi

+2-2
Original file line numberDiff line numberDiff line change
@@ -256,9 +256,9 @@ class Text(CharacterData):
256256
nodeName: str
257257
attributes: Incomplete
258258
data: Incomplete
259-
def splitText(self, offset): ...
259+
def splitText(self, offset: int) -> Self: ...
260260
def writexml(self, writer: SupportsWrite[str], indent: str = "", addindent: str = "", newl: str = "") -> None: ...
261-
def replaceWholeText(self, content): ...
261+
def replaceWholeText(self, content) -> Self | None: ...
262262
@property
263263
def isWhitespaceInElementContent(self) -> bool: ...
264264
@property

‎mypy/typeshed/stdlib/xml/dom/xmlbuilder.pyi

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class DOMBuilder:
6060
def supportsFeature(self, name: str) -> bool: ...
6161
def canSetFeature(self, name: str, state: int) -> bool: ...
6262
# getFeature could return any attribute from an instance of `Options`
63-
def getFeature(self, name: str): ...
63+
def getFeature(self, name: str) -> Any: ...
6464
def parseURI(self, uri: str) -> ExpatBuilder | ExpatBuilderNS: ...
6565
def parse(self, input: DOMInputSource) -> ExpatBuilder | ExpatBuilderNS: ...
6666
# `input` and `cnode` argtypes for `parseWithContext` are unknowable

0 commit comments

Comments
 (0)
Please sign in to comment.