Big diff: Use new "|" union syntax (#5872)

This commit is contained in:
Akuli
2021-08-08 12:05:21 +03:00
committed by GitHub
parent b9adb7a874
commit ee487304d7
578 changed files with 8080 additions and 8966 deletions

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, Dict, NoReturn, Optional, Sequence, Tuple, Union, overload
from typing import Any, Dict, NoReturn, Sequence, Tuple, overload
from typing_extensions import Literal
CREATE_NEW_CONSOLE: int
@@ -52,7 +52,7 @@ def ConnectNamedPipe(handle: int, overlapped: Literal[True]) -> Overlapped: ...
@overload
def ConnectNamedPipe(handle: int, overlapped: Literal[False] = ...) -> None: ...
@overload
def ConnectNamedPipe(handle: int, overlapped: bool) -> Optional[Overlapped]: ...
def ConnectNamedPipe(handle: int, overlapped: bool) -> Overlapped | None: ...
def CreateFile(
__file_name: str,
__desired_access: int,
@@ -75,14 +75,14 @@ def CreateNamedPipe(
) -> int: ...
def CreatePipe(__pipe_attrs: Any, __size: int) -> Tuple[int, int]: ...
def CreateProcess(
__application_name: Optional[str],
__command_line: Optional[str],
__application_name: str | None,
__command_line: str | None,
__proc_attrs: Any,
__thread_attrs: Any,
__inherit_handles: bool,
__creation_flags: int,
__env_mapping: Dict[str, str],
__current_directory: Optional[str],
__current_directory: str | None,
__startup_info: Any,
) -> Tuple[int, int, int, int]: ...
def DuplicateHandle(
@@ -106,15 +106,15 @@ def GetModuleFileName(__module_handle: int) -> str: ...
def GetStdHandle(__std_handle: int) -> int: ...
def GetVersion() -> int: ...
def OpenProcess(__desired_access: int, __inherit_handle: bool, __process_id: int) -> int: ...
def PeekNamedPipe(__handle: int, __size: int = ...) -> Union[Tuple[int, int], Tuple[bytes, int, int]]: ...
def PeekNamedPipe(__handle: int, __size: int = ...) -> Tuple[int, int] | Tuple[bytes, int, int]: ...
@overload
def ReadFile(handle: int, size: int, overlapped: Literal[True]) -> Tuple[Overlapped, int]: ...
@overload
def ReadFile(handle: int, size: int, overlapped: Literal[False] = ...) -> Tuple[bytes, int]: ...
@overload
def ReadFile(handle: int, size: int, overlapped: Union[int, bool]) -> Tuple[Any, int]: ...
def ReadFile(handle: int, size: int, overlapped: int | bool) -> Tuple[Any, int]: ...
def SetNamedPipeHandleState(
__named_pipe: int, __mode: Optional[int], __max_collection_count: Optional[int], __collect_data_timeout: Optional[int]
__named_pipe: int, __mode: int | None, __max_collection_count: int | None, __collect_data_timeout: int | None
) -> None: ...
def TerminateProcess(__handle: int, __exit_code: int) -> None: ...
def WaitForMultipleObjects(__handle_seq: Sequence[int], __wait_flag: bool, __milliseconds: int = ...) -> int: ...
@@ -125,10 +125,10 @@ def WriteFile(handle: int, buffer: bytes, overlapped: Literal[True]) -> Tuple[Ov
@overload
def WriteFile(handle: int, buffer: bytes, overlapped: Literal[False] = ...) -> Tuple[int, int]: ...
@overload
def WriteFile(handle: int, buffer: bytes, overlapped: Union[int, bool]) -> Tuple[Any, int]: ...
def WriteFile(handle: int, buffer: bytes, overlapped: int | bool) -> Tuple[Any, int]: ...
class Overlapped:
event: int = ...
def GetOverlappedResult(self, __wait: bool) -> Tuple[int, int]: ...
def cancel(self) -> None: ...
def getbuffer(self) -> Optional[bytes]: ...
def getbuffer(self) -> bytes | None: ...