basedpyright 1.12.6 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/dist/pyright-langserver.js +1 -1
  2. package/dist/pyright-langserver.js.map +1 -1
  3. package/dist/pyright.js +1 -1
  4. package/dist/pyright.js.map +1 -1
  5. package/dist/typeshed-fallback/stdlib/_ast.pyi +279 -42
  6. package/dist/typeshed-fallback/stdlib/_bisect.pyi +149 -12
  7. package/dist/typeshed-fallback/stdlib/_codecs.pyi +125 -14
  8. package/dist/typeshed-fallback/stdlib/_csv.pyi +130 -7
  9. package/dist/typeshed-fallback/stdlib/_ctypes.pyi +72 -17
  10. package/dist/typeshed-fallback/stdlib/_curses.pyi +626 -78
  11. package/dist/typeshed-fallback/stdlib/_decimal.pyi +775 -153
  12. package/dist/typeshed-fallback/stdlib/_heapq.pyi +61 -5
  13. package/dist/typeshed-fallback/stdlib/_imp.pyi +70 -15
  14. package/dist/typeshed-fallback/stdlib/_json.pyi +55 -12
  15. package/dist/typeshed-fallback/stdlib/_locale.pyi +63 -12
  16. package/dist/typeshed-fallback/stdlib/_lsprof.pyi +61 -4
  17. package/dist/typeshed-fallback/stdlib/_operator.pyi +238 -62
  18. package/dist/typeshed-fallback/stdlib/_posixsubprocess.pyi +25 -1
  19. package/dist/typeshed-fallback/stdlib/_random.pyi +23 -5
  20. package/dist/typeshed-fallback/stdlib/_socket.pyi +618 -63
  21. package/dist/typeshed-fallback/stdlib/_stat.pyi +140 -13
  22. package/dist/typeshed-fallback/stdlib/_thread.pyi +215 -22
  23. package/dist/typeshed-fallback/stdlib/_tkinter.pyi +44 -11
  24. package/dist/typeshed-fallback/stdlib/_tracemalloc.pyi +71 -10
  25. package/dist/typeshed-fallback/stdlib/_warnings.pyi +53 -6
  26. package/dist/typeshed-fallback/stdlib/_weakref.pyi +43 -10
  27. package/dist/typeshed-fallback/stdlib/_winapi.pyi +255 -255
  28. package/dist/typeshed-fallback/stdlib/array.pyi +233 -44
  29. package/dist/typeshed-fallback/stdlib/atexit.pyi +50 -5
  30. package/dist/typeshed-fallback/stdlib/audioop.pyi +78 -26
  31. package/dist/typeshed-fallback/stdlib/binascii.pyi +105 -18
  32. package/dist/typeshed-fallback/stdlib/builtins.pyi +5254 -829
  33. package/dist/typeshed-fallback/stdlib/cmath.pyi +99 -23
  34. package/dist/typeshed-fallback/stdlib/errno.pyi +15 -0
  35. package/dist/typeshed-fallback/stdlib/faulthandler.pyi +33 -8
  36. package/dist/typeshed-fallback/stdlib/fcntl.pyi +199 -8
  37. package/dist/typeshed-fallback/stdlib/gc.pyi +130 -18
  38. package/dist/typeshed-fallback/stdlib/grp.pyi +58 -7
  39. package/dist/typeshed-fallback/stdlib/itertools.pyi +281 -42
  40. package/dist/typeshed-fallback/stdlib/marshal.pyi +82 -4
  41. package/dist/typeshed-fallback/stdlib/math.pyi +357 -61
  42. package/dist/typeshed-fallback/stdlib/mmap.pyi +47 -8
  43. package/dist/typeshed-fallback/stdlib/msvcrt.pyi +32 -32
  44. package/dist/typeshed-fallback/stdlib/nt.pyi +118 -111
  45. package/dist/typeshed-fallback/stdlib/parser.pyi +55 -24
  46. package/dist/typeshed-fallback/stdlib/posix.pyi +7 -0
  47. package/dist/typeshed-fallback/stdlib/pwd.pyi +60 -10
  48. package/dist/typeshed-fallback/stdlib/pyexpat/__init__.pyi +61 -12
  49. package/dist/typeshed-fallback/stdlib/readline.pyi +184 -27
  50. package/dist/typeshed-fallback/stdlib/resource.pyi +56 -16
  51. package/dist/typeshed-fallback/stdlib/select.pyi +97 -5
  52. package/dist/typeshed-fallback/stdlib/spwd.pyi +60 -11
  53. package/dist/typeshed-fallback/stdlib/sys/__init__.pyi +386 -48
  54. package/dist/typeshed-fallback/stdlib/syslog.pyi +27 -7
  55. package/dist/typeshed-fallback/stdlib/termios.pyi +88 -8
  56. package/dist/typeshed-fallback/stdlib/time.pyi +314 -37
  57. package/dist/typeshed-fallback/stdlib/unicodedata.pyi +264 -34
  58. package/dist/typeshed-fallback/stdlib/winreg.pyi +172 -132
  59. package/dist/typeshed-fallback/stdlib/zlib.pyi +108 -7
  60. package/package.json +1 -1
@@ -1,3 +1,5 @@
1
+ """Weak-reference support module."""
2
+
1
3
  import sys
2
4
  from collections.abc import Callable
3
5
  from typing import Any, Generic, TypeVar, final, overload
@@ -11,31 +13,62 @@ _T = TypeVar("_T")
11
13
 
12
14
  @final
13
15
  class CallableProxyType(Generic[_C]): # "weakcallableproxy"
14
- def __eq__(self, value: object, /) -> bool: ...
16
+ def __eq__(self, value: object, /) -> bool:
17
+ """Return self==value."""
18
+ ...
15
19
  def __getattr__(self, attr: str) -> Any: ...
16
20
  __call__: _C
17
21
 
18
22
  @final
19
23
  class ProxyType(Generic[_T]): # "weakproxy"
20
- def __eq__(self, value: object, /) -> bool: ...
24
+ def __eq__(self, value: object, /) -> bool:
25
+ """Return self==value."""
26
+ ...
21
27
  def __getattr__(self, attr: str) -> Any: ...
22
28
 
23
29
  class ReferenceType(Generic[_T]):
24
30
  __callback__: Callable[[ReferenceType[_T]], Any]
25
31
  def __new__(cls, o: _T, callback: Callable[[ReferenceType[_T]], Any] | None = ..., /) -> Self: ...
26
- def __call__(self) -> _T | None: ...
27
- def __eq__(self, value: object, /) -> bool: ...
28
- def __hash__(self) -> int: ...
32
+ def __call__(self) -> _T | None:
33
+ """Call self as a function."""
34
+ ...
35
+ def __eq__(self, value: object, /) -> bool:
36
+ """Return self==value."""
37
+ ...
38
+ def __hash__(self) -> int:
39
+ """Return hash(self)."""
40
+ ...
29
41
  if sys.version_info >= (3, 9):
30
- def __class_getitem__(cls, item: Any, /) -> GenericAlias: ...
42
+ def __class_getitem__(cls, item: Any, /) -> GenericAlias:
43
+ """See PEP 585"""
44
+ ...
31
45
 
32
46
  ref = ReferenceType
33
47
 
34
- def getweakrefcount(object: Any, /) -> int: ...
35
- def getweakrefs(object: Any, /) -> list[Any]: ...
48
+ def getweakrefcount(object: Any, /) -> int:
49
+ """Return the number of weak references to 'object'."""
50
+ ...
51
+ def getweakrefs(object: Any, /) -> list[Any]:
52
+ """
53
+ getweakrefs(object) -- return a list of all weak reference objects
54
+ that point to 'object'.
55
+ """
56
+ ...
36
57
 
37
58
  # Return CallableProxyType if object is callable, ProxyType otherwise
38
59
  @overload
39
- def proxy(object: _C, callback: Callable[[_C], Any] | None = None, /) -> CallableProxyType[_C]: ...
60
+ def proxy(object: _C, callback: Callable[[_C], Any] | None = None, /) -> CallableProxyType[_C]:
61
+ """
62
+ proxy(object[, callback]) -- create a proxy object that weakly
63
+ references 'object'. 'callback', if given, is called with a
64
+ reference to the proxy when 'object' is about to be finalized.
65
+ """
66
+ ...
40
67
  @overload
41
- def proxy(object: _T, callback: Callable[[_T], Any] | None = None, /) -> Any: ...
68
+ def proxy(object: _T, callback: Callable[[_T], Any] | None = None, /) -> Any:
69
+ """
70
+ proxy(object[, callback]) -- create a proxy object that weakly
71
+ references 'object'. 'callback', if given, is called with a
72
+ reference to the proxy when 'object' is about to be finalized.
73
+ """
74
+ ...
@@ -1,255 +1,255 @@
1
- import sys
2
- from _typeshed import ReadableBuffer
3
- from collections.abc import Sequence
4
- from typing import Any, Literal, NoReturn, final, overload
5
-
6
- if sys.platform == "win32":
7
- ABOVE_NORMAL_PRIORITY_CLASS: Literal[0x8000]
8
- BELOW_NORMAL_PRIORITY_CLASS: Literal[0x4000]
9
-
10
- CREATE_BREAKAWAY_FROM_JOB: Literal[0x1000000]
11
- CREATE_DEFAULT_ERROR_MODE: Literal[0x4000000]
12
- CREATE_NO_WINDOW: Literal[0x8000000]
13
- CREATE_NEW_CONSOLE: Literal[0x10]
14
- CREATE_NEW_PROCESS_GROUP: Literal[0x200]
15
-
16
- DETACHED_PROCESS: Literal[8]
17
- DUPLICATE_CLOSE_SOURCE: Literal[1]
18
- DUPLICATE_SAME_ACCESS: Literal[2]
19
-
20
- ERROR_ALREADY_EXISTS: Literal[183]
21
- ERROR_BROKEN_PIPE: Literal[109]
22
- ERROR_IO_PENDING: Literal[997]
23
- ERROR_MORE_DATA: Literal[234]
24
- ERROR_NETNAME_DELETED: Literal[64]
25
- ERROR_NO_DATA: Literal[232]
26
- ERROR_NO_SYSTEM_RESOURCES: Literal[1450]
27
- ERROR_OPERATION_ABORTED: Literal[995]
28
- ERROR_PIPE_BUSY: Literal[231]
29
- ERROR_PIPE_CONNECTED: Literal[535]
30
- ERROR_SEM_TIMEOUT: Literal[121]
31
-
32
- FILE_FLAG_FIRST_PIPE_INSTANCE: Literal[0x80000]
33
- FILE_FLAG_OVERLAPPED: Literal[0x40000000]
34
-
35
- FILE_GENERIC_READ: Literal[1179785]
36
- FILE_GENERIC_WRITE: Literal[1179926]
37
-
38
- FILE_MAP_ALL_ACCESS: Literal[983071]
39
- FILE_MAP_COPY: Literal[1]
40
- FILE_MAP_EXECUTE: Literal[32]
41
- FILE_MAP_READ: Literal[4]
42
- FILE_MAP_WRITE: Literal[2]
43
-
44
- FILE_TYPE_CHAR: Literal[2]
45
- FILE_TYPE_DISK: Literal[1]
46
- FILE_TYPE_PIPE: Literal[3]
47
- FILE_TYPE_REMOTE: Literal[32768]
48
- FILE_TYPE_UNKNOWN: Literal[0]
49
-
50
- GENERIC_READ: Literal[0x80000000]
51
- GENERIC_WRITE: Literal[0x40000000]
52
- HIGH_PRIORITY_CLASS: Literal[0x80]
53
- INFINITE: Literal[0xFFFFFFFF]
54
- # Ignore the Flake8 error -- flake8-pyi assumes
55
- # most numbers this long will be implementation details,
56
- # but here we can see that it's a power of 2
57
- INVALID_HANDLE_VALUE: Literal[0xFFFFFFFFFFFFFFFF] # noqa: Y054
58
- IDLE_PRIORITY_CLASS: Literal[0x40]
59
- NORMAL_PRIORITY_CLASS: Literal[0x20]
60
- REALTIME_PRIORITY_CLASS: Literal[0x100]
61
- NMPWAIT_WAIT_FOREVER: Literal[0xFFFFFFFF]
62
-
63
- MEM_COMMIT: Literal[0x1000]
64
- MEM_FREE: Literal[0x10000]
65
- MEM_IMAGE: Literal[0x1000000]
66
- MEM_MAPPED: Literal[0x40000]
67
- MEM_PRIVATE: Literal[0x20000]
68
- MEM_RESERVE: Literal[0x2000]
69
-
70
- NULL: Literal[0]
71
- OPEN_EXISTING: Literal[3]
72
-
73
- PIPE_ACCESS_DUPLEX: Literal[3]
74
- PIPE_ACCESS_INBOUND: Literal[1]
75
- PIPE_READMODE_MESSAGE: Literal[2]
76
- PIPE_TYPE_MESSAGE: Literal[4]
77
- PIPE_UNLIMITED_INSTANCES: Literal[255]
78
- PIPE_WAIT: Literal[0]
79
-
80
- PAGE_EXECUTE: Literal[0x10]
81
- PAGE_EXECUTE_READ: Literal[0x20]
82
- PAGE_EXECUTE_READWRITE: Literal[0x40]
83
- PAGE_EXECUTE_WRITECOPY: Literal[0x80]
84
- PAGE_GUARD: Literal[0x100]
85
- PAGE_NOACCESS: Literal[0x1]
86
- PAGE_NOCACHE: Literal[0x200]
87
- PAGE_READONLY: Literal[0x2]
88
- PAGE_READWRITE: Literal[0x4]
89
- PAGE_WRITECOMBINE: Literal[0x400]
90
- PAGE_WRITECOPY: Literal[0x8]
91
-
92
- PROCESS_ALL_ACCESS: Literal[0x1FFFFF]
93
- PROCESS_DUP_HANDLE: Literal[0x40]
94
-
95
- SEC_COMMIT: Literal[0x8000000]
96
- SEC_IMAGE: Literal[0x1000000]
97
- SEC_LARGE_PAGES: Literal[0x80000000]
98
- SEC_NOCACHE: Literal[0x10000000]
99
- SEC_RESERVE: Literal[0x4000000]
100
- SEC_WRITECOMBINE: Literal[0x40000000]
101
-
102
- STARTF_USESHOWWINDOW: Literal[0x1]
103
- STARTF_USESTDHANDLES: Literal[0x100]
104
-
105
- STD_ERROR_HANDLE: Literal[0xFFFFFFF4]
106
- STD_OUTPUT_HANDLE: Literal[0xFFFFFFF5]
107
- STD_INPUT_HANDLE: Literal[0xFFFFFFF6]
108
-
109
- STILL_ACTIVE: Literal[259]
110
- SW_HIDE: Literal[0]
111
- SYNCHRONIZE: Literal[0x100000]
112
- WAIT_ABANDONED_0: Literal[128]
113
- WAIT_OBJECT_0: Literal[0]
114
- WAIT_TIMEOUT: Literal[258]
115
-
116
- if sys.version_info >= (3, 10):
117
- LOCALE_NAME_INVARIANT: str
118
- LOCALE_NAME_MAX_LENGTH: int
119
- LOCALE_NAME_SYSTEM_DEFAULT: str
120
- LOCALE_NAME_USER_DEFAULT: str | None
121
-
122
- LCMAP_FULLWIDTH: int
123
- LCMAP_HALFWIDTH: int
124
- LCMAP_HIRAGANA: int
125
- LCMAP_KATAKANA: int
126
- LCMAP_LINGUISTIC_CASING: int
127
- LCMAP_LOWERCASE: int
128
- LCMAP_SIMPLIFIED_CHINESE: int
129
- LCMAP_TITLECASE: int
130
- LCMAP_TRADITIONAL_CHINESE: int
131
- LCMAP_UPPERCASE: int
132
-
133
- if sys.version_info >= (3, 12):
134
- COPYFILE2_CALLBACK_CHUNK_STARTED: Literal[1]
135
- COPYFILE2_CALLBACK_CHUNK_FINISHED: Literal[2]
136
- COPYFILE2_CALLBACK_STREAM_STARTED: Literal[3]
137
- COPYFILE2_CALLBACK_STREAM_FINISHED: Literal[4]
138
- COPYFILE2_CALLBACK_POLL_CONTINUE: Literal[5]
139
- COPYFILE2_CALLBACK_ERROR: Literal[6]
140
-
141
- COPYFILE2_PROGRESS_CONTINUE: Literal[0]
142
- COPYFILE2_PROGRESS_CANCEL: Literal[1]
143
- COPYFILE2_PROGRESS_STOP: Literal[2]
144
- COPYFILE2_PROGRESS_QUIET: Literal[3]
145
- COPYFILE2_PROGRESS_PAUSE: Literal[4]
146
-
147
- COPY_FILE_FAIL_IF_EXISTS: Literal[0x1]
148
- COPY_FILE_RESTARTABLE: Literal[0x2]
149
- COPY_FILE_OPEN_SOURCE_FOR_WRITE: Literal[0x4]
150
- COPY_FILE_ALLOW_DECRYPTED_DESTINATION: Literal[0x8]
151
- COPY_FILE_COPY_SYMLINK: Literal[0x800]
152
- COPY_FILE_NO_BUFFERING: Literal[0x1000]
153
- COPY_FILE_REQUEST_SECURITY_PRIVILEGES: Literal[0x2000]
154
- COPY_FILE_RESUME_FROM_PAUSE: Literal[0x4000]
155
- COPY_FILE_NO_OFFLOAD: Literal[0x40000]
156
- COPY_FILE_REQUEST_COMPRESSED_TRAFFIC: Literal[0x10000000]
157
-
158
- ERROR_ACCESS_DENIED: Literal[5]
159
- ERROR_PRIVILEGE_NOT_HELD: Literal[1314]
160
-
161
- def CloseHandle(handle: int, /) -> None: ...
162
- @overload
163
- def ConnectNamedPipe(handle: int, overlapped: Literal[True]) -> Overlapped: ...
164
- @overload
165
- def ConnectNamedPipe(handle: int, overlapped: Literal[False] = False) -> None: ...
166
- @overload
167
- def ConnectNamedPipe(handle: int, overlapped: bool) -> Overlapped | None: ...
168
- def CreateFile(
169
- file_name: str,
170
- desired_access: int,
171
- share_mode: int,
172
- security_attributes: int,
173
- creation_disposition: int,
174
- flags_and_attributes: int,
175
- template_file: int,
176
- /,
177
- ) -> int: ...
178
- def CreateJunction(src_path: str, dst_path: str, /) -> None: ...
179
- def CreateNamedPipe(
180
- name: str,
181
- open_mode: int,
182
- pipe_mode: int,
183
- max_instances: int,
184
- out_buffer_size: int,
185
- in_buffer_size: int,
186
- default_timeout: int,
187
- security_attributes: int,
188
- /,
189
- ) -> int: ...
190
- def CreatePipe(pipe_attrs: Any, size: int, /) -> tuple[int, int]: ...
191
- def CreateProcess(
192
- application_name: str | None,
193
- command_line: str | None,
194
- proc_attrs: Any,
195
- thread_attrs: Any,
196
- inherit_handles: bool,
197
- creation_flags: int,
198
- env_mapping: dict[str, str],
199
- current_directory: str | None,
200
- startup_info: Any,
201
- /,
202
- ) -> tuple[int, int, int, int]: ...
203
- def DuplicateHandle(
204
- source_process_handle: int,
205
- source_handle: int,
206
- target_process_handle: int,
207
- desired_access: int,
208
- inherit_handle: bool,
209
- options: int = 0,
210
- /,
211
- ) -> int: ...
212
- def ExitProcess(ExitCode: int, /) -> NoReturn: ...
213
- def GetACP() -> int: ...
214
- def GetFileType(handle: int) -> int: ...
215
- def GetCurrentProcess() -> int: ...
216
- def GetExitCodeProcess(process: int, /) -> int: ...
217
- def GetLastError() -> int: ...
218
- def GetModuleFileName(module_handle: int, /) -> str: ...
219
- def GetStdHandle(std_handle: int, /) -> int: ...
220
- def GetVersion() -> int: ...
221
- def OpenProcess(desired_access: int, inherit_handle: bool, process_id: int, /) -> int: ...
222
- def PeekNamedPipe(handle: int, size: int = 0, /) -> tuple[int, int] | tuple[bytes, int, int]: ...
223
- if sys.version_info >= (3, 10):
224
- def LCMapStringEx(locale: str, flags: int, src: str) -> str: ...
225
- def UnmapViewOfFile(address: int, /) -> None: ...
226
-
227
- @overload
228
- def ReadFile(handle: int, size: int, overlapped: Literal[True]) -> tuple[Overlapped, int]: ...
229
- @overload
230
- def ReadFile(handle: int, size: int, overlapped: Literal[False] = False) -> tuple[bytes, int]: ...
231
- @overload
232
- def ReadFile(handle: int, size: int, overlapped: int | bool) -> tuple[Any, int]: ...
233
- def SetNamedPipeHandleState(
234
- named_pipe: int, mode: int | None, max_collection_count: int | None, collect_data_timeout: int | None, /
235
- ) -> None: ...
236
- def TerminateProcess(handle: int, exit_code: int, /) -> None: ...
237
- def WaitForMultipleObjects(handle_seq: Sequence[int], wait_flag: bool, milliseconds: int = 0xFFFFFFFF, /) -> int: ...
238
- def WaitForSingleObject(handle: int, milliseconds: int, /) -> int: ...
239
- def WaitNamedPipe(name: str, timeout: int, /) -> None: ...
240
- @overload
241
- def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: Literal[True]) -> tuple[Overlapped, int]: ...
242
- @overload
243
- def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: Literal[False] = False) -> tuple[int, int]: ...
244
- @overload
245
- def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: int | bool) -> tuple[Any, int]: ...
246
- @final
247
- class Overlapped:
248
- event: int
249
- def GetOverlappedResult(self, wait: bool, /) -> tuple[int, int]: ...
250
- def cancel(self) -> None: ...
251
- def getbuffer(self) -> bytes | None: ...
252
-
253
- if sys.version_info >= (3, 12):
254
- def CopyFile2(existing_file_name: str, new_file_name: str, flags: int, progress_routine: int | None = None) -> int: ...
255
- def NeedCurrentDirectoryForExePath(exe_name: str, /) -> bool: ...
1
+ import sys
2
+ from _typeshed import ReadableBuffer
3
+ from collections.abc import Sequence
4
+ from typing import Any, Literal, NoReturn, final, overload
5
+
6
+ if sys.platform == "win32":
7
+ ABOVE_NORMAL_PRIORITY_CLASS: Literal[0x8000]
8
+ BELOW_NORMAL_PRIORITY_CLASS: Literal[0x4000]
9
+
10
+ CREATE_BREAKAWAY_FROM_JOB: Literal[0x1000000]
11
+ CREATE_DEFAULT_ERROR_MODE: Literal[0x4000000]
12
+ CREATE_NO_WINDOW: Literal[0x8000000]
13
+ CREATE_NEW_CONSOLE: Literal[0x10]
14
+ CREATE_NEW_PROCESS_GROUP: Literal[0x200]
15
+
16
+ DETACHED_PROCESS: Literal[8]
17
+ DUPLICATE_CLOSE_SOURCE: Literal[1]
18
+ DUPLICATE_SAME_ACCESS: Literal[2]
19
+
20
+ ERROR_ALREADY_EXISTS: Literal[183]
21
+ ERROR_BROKEN_PIPE: Literal[109]
22
+ ERROR_IO_PENDING: Literal[997]
23
+ ERROR_MORE_DATA: Literal[234]
24
+ ERROR_NETNAME_DELETED: Literal[64]
25
+ ERROR_NO_DATA: Literal[232]
26
+ ERROR_NO_SYSTEM_RESOURCES: Literal[1450]
27
+ ERROR_OPERATION_ABORTED: Literal[995]
28
+ ERROR_PIPE_BUSY: Literal[231]
29
+ ERROR_PIPE_CONNECTED: Literal[535]
30
+ ERROR_SEM_TIMEOUT: Literal[121]
31
+
32
+ FILE_FLAG_FIRST_PIPE_INSTANCE: Literal[0x80000]
33
+ FILE_FLAG_OVERLAPPED: Literal[0x40000000]
34
+
35
+ FILE_GENERIC_READ: Literal[1179785]
36
+ FILE_GENERIC_WRITE: Literal[1179926]
37
+
38
+ FILE_MAP_ALL_ACCESS: Literal[983071]
39
+ FILE_MAP_COPY: Literal[1]
40
+ FILE_MAP_EXECUTE: Literal[32]
41
+ FILE_MAP_READ: Literal[4]
42
+ FILE_MAP_WRITE: Literal[2]
43
+
44
+ FILE_TYPE_CHAR: Literal[2]
45
+ FILE_TYPE_DISK: Literal[1]
46
+ FILE_TYPE_PIPE: Literal[3]
47
+ FILE_TYPE_REMOTE: Literal[32768]
48
+ FILE_TYPE_UNKNOWN: Literal[0]
49
+
50
+ GENERIC_READ: Literal[0x80000000]
51
+ GENERIC_WRITE: Literal[0x40000000]
52
+ HIGH_PRIORITY_CLASS: Literal[0x80]
53
+ INFINITE: Literal[0xFFFFFFFF]
54
+ # Ignore the Flake8 error -- flake8-pyi assumes
55
+ # most numbers this long will be implementation details,
56
+ # but here we can see that it's a power of 2
57
+ INVALID_HANDLE_VALUE: Literal[0xFFFFFFFFFFFFFFFF] # noqa: Y054
58
+ IDLE_PRIORITY_CLASS: Literal[0x40]
59
+ NORMAL_PRIORITY_CLASS: Literal[0x20]
60
+ REALTIME_PRIORITY_CLASS: Literal[0x100]
61
+ NMPWAIT_WAIT_FOREVER: Literal[0xFFFFFFFF]
62
+
63
+ MEM_COMMIT: Literal[0x1000]
64
+ MEM_FREE: Literal[0x10000]
65
+ MEM_IMAGE: Literal[0x1000000]
66
+ MEM_MAPPED: Literal[0x40000]
67
+ MEM_PRIVATE: Literal[0x20000]
68
+ MEM_RESERVE: Literal[0x2000]
69
+
70
+ NULL: Literal[0]
71
+ OPEN_EXISTING: Literal[3]
72
+
73
+ PIPE_ACCESS_DUPLEX: Literal[3]
74
+ PIPE_ACCESS_INBOUND: Literal[1]
75
+ PIPE_READMODE_MESSAGE: Literal[2]
76
+ PIPE_TYPE_MESSAGE: Literal[4]
77
+ PIPE_UNLIMITED_INSTANCES: Literal[255]
78
+ PIPE_WAIT: Literal[0]
79
+
80
+ PAGE_EXECUTE: Literal[0x10]
81
+ PAGE_EXECUTE_READ: Literal[0x20]
82
+ PAGE_EXECUTE_READWRITE: Literal[0x40]
83
+ PAGE_EXECUTE_WRITECOPY: Literal[0x80]
84
+ PAGE_GUARD: Literal[0x100]
85
+ PAGE_NOACCESS: Literal[0x1]
86
+ PAGE_NOCACHE: Literal[0x200]
87
+ PAGE_READONLY: Literal[0x2]
88
+ PAGE_READWRITE: Literal[0x4]
89
+ PAGE_WRITECOMBINE: Literal[0x400]
90
+ PAGE_WRITECOPY: Literal[0x8]
91
+
92
+ PROCESS_ALL_ACCESS: Literal[0x1FFFFF]
93
+ PROCESS_DUP_HANDLE: Literal[0x40]
94
+
95
+ SEC_COMMIT: Literal[0x8000000]
96
+ SEC_IMAGE: Literal[0x1000000]
97
+ SEC_LARGE_PAGES: Literal[0x80000000]
98
+ SEC_NOCACHE: Literal[0x10000000]
99
+ SEC_RESERVE: Literal[0x4000000]
100
+ SEC_WRITECOMBINE: Literal[0x40000000]
101
+
102
+ STARTF_USESHOWWINDOW: Literal[0x1]
103
+ STARTF_USESTDHANDLES: Literal[0x100]
104
+
105
+ STD_ERROR_HANDLE: Literal[0xFFFFFFF4]
106
+ STD_OUTPUT_HANDLE: Literal[0xFFFFFFF5]
107
+ STD_INPUT_HANDLE: Literal[0xFFFFFFF6]
108
+
109
+ STILL_ACTIVE: Literal[259]
110
+ SW_HIDE: Literal[0]
111
+ SYNCHRONIZE: Literal[0x100000]
112
+ WAIT_ABANDONED_0: Literal[128]
113
+ WAIT_OBJECT_0: Literal[0]
114
+ WAIT_TIMEOUT: Literal[258]
115
+
116
+ if sys.version_info >= (3, 10):
117
+ LOCALE_NAME_INVARIANT: str
118
+ LOCALE_NAME_MAX_LENGTH: int
119
+ LOCALE_NAME_SYSTEM_DEFAULT: str
120
+ LOCALE_NAME_USER_DEFAULT: str | None
121
+
122
+ LCMAP_FULLWIDTH: int
123
+ LCMAP_HALFWIDTH: int
124
+ LCMAP_HIRAGANA: int
125
+ LCMAP_KATAKANA: int
126
+ LCMAP_LINGUISTIC_CASING: int
127
+ LCMAP_LOWERCASE: int
128
+ LCMAP_SIMPLIFIED_CHINESE: int
129
+ LCMAP_TITLECASE: int
130
+ LCMAP_TRADITIONAL_CHINESE: int
131
+ LCMAP_UPPERCASE: int
132
+
133
+ if sys.version_info >= (3, 12):
134
+ COPYFILE2_CALLBACK_CHUNK_STARTED: Literal[1]
135
+ COPYFILE2_CALLBACK_CHUNK_FINISHED: Literal[2]
136
+ COPYFILE2_CALLBACK_STREAM_STARTED: Literal[3]
137
+ COPYFILE2_CALLBACK_STREAM_FINISHED: Literal[4]
138
+ COPYFILE2_CALLBACK_POLL_CONTINUE: Literal[5]
139
+ COPYFILE2_CALLBACK_ERROR: Literal[6]
140
+
141
+ COPYFILE2_PROGRESS_CONTINUE: Literal[0]
142
+ COPYFILE2_PROGRESS_CANCEL: Literal[1]
143
+ COPYFILE2_PROGRESS_STOP: Literal[2]
144
+ COPYFILE2_PROGRESS_QUIET: Literal[3]
145
+ COPYFILE2_PROGRESS_PAUSE: Literal[4]
146
+
147
+ COPY_FILE_FAIL_IF_EXISTS: Literal[0x1]
148
+ COPY_FILE_RESTARTABLE: Literal[0x2]
149
+ COPY_FILE_OPEN_SOURCE_FOR_WRITE: Literal[0x4]
150
+ COPY_FILE_ALLOW_DECRYPTED_DESTINATION: Literal[0x8]
151
+ COPY_FILE_COPY_SYMLINK: Literal[0x800]
152
+ COPY_FILE_NO_BUFFERING: Literal[0x1000]
153
+ COPY_FILE_REQUEST_SECURITY_PRIVILEGES: Literal[0x2000]
154
+ COPY_FILE_RESUME_FROM_PAUSE: Literal[0x4000]
155
+ COPY_FILE_NO_OFFLOAD: Literal[0x40000]
156
+ COPY_FILE_REQUEST_COMPRESSED_TRAFFIC: Literal[0x10000000]
157
+
158
+ ERROR_ACCESS_DENIED: Literal[5]
159
+ ERROR_PRIVILEGE_NOT_HELD: Literal[1314]
160
+
161
+ def CloseHandle(handle: int, /) -> None: ...
162
+ @overload
163
+ def ConnectNamedPipe(handle: int, overlapped: Literal[True]) -> Overlapped: ...
164
+ @overload
165
+ def ConnectNamedPipe(handle: int, overlapped: Literal[False] = False) -> None: ...
166
+ @overload
167
+ def ConnectNamedPipe(handle: int, overlapped: bool) -> Overlapped | None: ...
168
+ def CreateFile(
169
+ file_name: str,
170
+ desired_access: int,
171
+ share_mode: int,
172
+ security_attributes: int,
173
+ creation_disposition: int,
174
+ flags_and_attributes: int,
175
+ template_file: int,
176
+ /,
177
+ ) -> int: ...
178
+ def CreateJunction(src_path: str, dst_path: str, /) -> None: ...
179
+ def CreateNamedPipe(
180
+ name: str,
181
+ open_mode: int,
182
+ pipe_mode: int,
183
+ max_instances: int,
184
+ out_buffer_size: int,
185
+ in_buffer_size: int,
186
+ default_timeout: int,
187
+ security_attributes: int,
188
+ /,
189
+ ) -> int: ...
190
+ def CreatePipe(pipe_attrs: Any, size: int, /) -> tuple[int, int]: ...
191
+ def CreateProcess(
192
+ application_name: str | None,
193
+ command_line: str | None,
194
+ proc_attrs: Any,
195
+ thread_attrs: Any,
196
+ inherit_handles: bool,
197
+ creation_flags: int,
198
+ env_mapping: dict[str, str],
199
+ current_directory: str | None,
200
+ startup_info: Any,
201
+ /,
202
+ ) -> tuple[int, int, int, int]: ...
203
+ def DuplicateHandle(
204
+ source_process_handle: int,
205
+ source_handle: int,
206
+ target_process_handle: int,
207
+ desired_access: int,
208
+ inherit_handle: bool,
209
+ options: int = 0,
210
+ /,
211
+ ) -> int: ...
212
+ def ExitProcess(ExitCode: int, /) -> NoReturn: ...
213
+ def GetACP() -> int: ...
214
+ def GetFileType(handle: int) -> int: ...
215
+ def GetCurrentProcess() -> int: ...
216
+ def GetExitCodeProcess(process: int, /) -> int: ...
217
+ def GetLastError() -> int: ...
218
+ def GetModuleFileName(module_handle: int, /) -> str: ...
219
+ def GetStdHandle(std_handle: int, /) -> int: ...
220
+ def GetVersion() -> int: ...
221
+ def OpenProcess(desired_access: int, inherit_handle: bool, process_id: int, /) -> int: ...
222
+ def PeekNamedPipe(handle: int, size: int = 0, /) -> tuple[int, int] | tuple[bytes, int, int]: ...
223
+ if sys.version_info >= (3, 10):
224
+ def LCMapStringEx(locale: str, flags: int, src: str) -> str: ...
225
+ def UnmapViewOfFile(address: int, /) -> None: ...
226
+
227
+ @overload
228
+ def ReadFile(handle: int, size: int, overlapped: Literal[True]) -> tuple[Overlapped, int]: ...
229
+ @overload
230
+ def ReadFile(handle: int, size: int, overlapped: Literal[False] = False) -> tuple[bytes, int]: ...
231
+ @overload
232
+ def ReadFile(handle: int, size: int, overlapped: int | bool) -> tuple[Any, int]: ...
233
+ def SetNamedPipeHandleState(
234
+ named_pipe: int, mode: int | None, max_collection_count: int | None, collect_data_timeout: int | None, /
235
+ ) -> None: ...
236
+ def TerminateProcess(handle: int, exit_code: int, /) -> None: ...
237
+ def WaitForMultipleObjects(handle_seq: Sequence[int], wait_flag: bool, milliseconds: int = 0xFFFFFFFF, /) -> int: ...
238
+ def WaitForSingleObject(handle: int, milliseconds: int, /) -> int: ...
239
+ def WaitNamedPipe(name: str, timeout: int, /) -> None: ...
240
+ @overload
241
+ def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: Literal[True]) -> tuple[Overlapped, int]: ...
242
+ @overload
243
+ def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: Literal[False] = False) -> tuple[int, int]: ...
244
+ @overload
245
+ def WriteFile(handle: int, buffer: ReadableBuffer, overlapped: int | bool) -> tuple[Any, int]: ...
246
+ @final
247
+ class Overlapped:
248
+ event: int
249
+ def GetOverlappedResult(self, wait: bool, /) -> tuple[int, int]: ...
250
+ def cancel(self) -> None: ...
251
+ def getbuffer(self) -> bytes | None: ...
252
+
253
+ if sys.version_info >= (3, 12):
254
+ def CopyFile2(existing_file_name: str, new_file_name: str, flags: int, progress_routine: int | None = None) -> int: ...
255
+ def NeedCurrentDirectoryForExePath(exe_name: str, /) -> bool: ...