Skip to content

Commit

Permalink
Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
hauntsaninja committed Mar 9, 2024
1 parent 65aa80d commit db218ce
Show file tree
Hide file tree
Showing 37 changed files with 296 additions and 255 deletions.
20 changes: 10 additions & 10 deletions stdlib/_codecs.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ def latin_1_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]:

if sys.version_info >= (3, 9):
def raw_unicode_escape_decode(
data: str | ReadableBuffer, errors: str | None = None, final: bool = True,
/) -> tuple[str, int]: ...
data: str | ReadableBuffer, errors: str | None = None, final: bool = True, /
) -> tuple[str, int]: ...

else:
def raw_unicode_escape_decode(data: str | ReadableBuffer, errors: str | None = None, /) -> tuple[str, int]: ...
Expand All @@ -92,8 +92,8 @@ def readbuffer_encode(data: str | ReadableBuffer, errors: str | None = None, /)

if sys.version_info >= (3, 9):
def unicode_escape_decode(
data: str | ReadableBuffer, errors: str | None = None, final: bool = True,
/) -> tuple[str, int]: ...
data: str | ReadableBuffer, errors: str | None = None, final: bool = True, /
) -> tuple[str, int]: ...

else:
def unicode_escape_decode(data: str | ReadableBuffer, errors: str | None = None, /) -> tuple[str, int]: ...
Expand All @@ -104,17 +104,17 @@ def utf_16_be_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int
def utf_16_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
def utf_16_encode(str: str, errors: str | None = None, byteorder: int = 0, /) -> tuple[bytes, int]: ...
def utf_16_ex_decode(
data: ReadableBuffer, errors: str | None = None, byteorder: int = 0, final: bool = False,
/) -> tuple[str, int, int]: ...
data: ReadableBuffer, errors: str | None = None, byteorder: int = 0, final: bool = False, /
) -> tuple[str, int, int]: ...
def utf_16_le_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
def utf_16_le_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
def utf_32_be_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
def utf_32_be_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
def utf_32_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
def utf_32_encode(str: str, errors: str | None = None, byteorder: int = 0, /) -> tuple[bytes, int]: ...
def utf_32_ex_decode(
data: ReadableBuffer, errors: str | None = None, byteorder: int = 0, final: bool = False,
/) -> tuple[str, int, int]: ...
data: ReadableBuffer, errors: str | None = None, byteorder: int = 0, final: bool = False, /
) -> tuple[str, int, int]: ...
def utf_32_le_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
def utf_32_le_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
def utf_7_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
Expand All @@ -126,8 +126,8 @@ if sys.platform == "win32":
def mbcs_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
def mbcs_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
def code_page_decode(
codepage: int, data: ReadableBuffer, errors: str | None = None, final: bool = False,
/) -> tuple[str, int]: ...
codepage: int, data: ReadableBuffer, errors: str | None = None, final: bool = False, /
) -> tuple[str, int]: ...
def code_page_encode(code_page: int, str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
def oem_decode(data: ReadableBuffer, errors: str | None = None, final: bool = False, /) -> tuple[str, int]: ...
def oem_encode(str: str, errors: str | None = None, /) -> tuple[bytes, int]: ...
4 changes: 2 additions & 2 deletions stdlib/_ctypes.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,8 @@ class CFuncPtr(_PointerLike, _CData):
if sys.platform == "win32":
@overload
def __init__(
self, vtbl_index: int, name: str, paramflags: tuple[_PF, ...] | None = ..., iid: _CData | None = ...,
/) -> None: ...
self, vtbl_index: int, name: str, paramflags: tuple[_PF, ...] | None = ..., iid: _CData | None = ..., /
) -> None: ...

def __call__(self, *args: Any, **kwargs: Any) -> Any: ...

Expand Down
3 changes: 2 additions & 1 deletion stdlib/_curses.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,8 @@ if sys.platform != "win32":
i7: int = 0,
i8: int = 0,
i9: int = 0,
/) -> bytes: ...
/,
) -> bytes: ...
def typeahead(fd: int, /) -> None: ...
def unctrl(ch: _ChType, /) -> bytes: ...
if sys.version_info < (3, 12) or sys.platform != "darwin":
Expand Down
3 changes: 2 additions & 1 deletion stdlib/_posixsubprocess.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,5 @@ if sys.platform != "win32":
child_umask: int,
preexec_fn: Callable[[], None],
allow_vfork: bool,
/) -> int: ...
/,
) -> int: ...
4 changes: 2 additions & 2 deletions stdlib/_py_abc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ def get_cache_token() -> _CacheToken: ...

class ABCMeta(type):
def __new__(
mcls: type[_typeshed.Self], name: str, bases: tuple[type[Any], ...], namespace: dict[str, Any],
/) -> _typeshed.Self: ...
mcls: type[_typeshed.Self], name: str, bases: tuple[type[Any], ...], namespace: dict[str, Any], /
) -> _typeshed.Self: ...
def register(cls, subclass: type[_T]) -> type[_T]: ...
7 changes: 4 additions & 3 deletions stdlib/_socket.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -719,8 +719,8 @@ class socket:
if sys.platform != "win32":
def recvmsg(self, bufsize: int, ancbufsize: int = ..., flags: int = ..., /) -> tuple[bytes, list[_CMSG], int, Any]: ...
def recvmsg_into(
self, buffers: Iterable[WriteableBuffer], ancbufsize: int = ..., flags: int = ...,
/) -> tuple[int, list[_CMSG], int, Any]: ...
self, buffers: Iterable[WriteableBuffer], ancbufsize: int = ..., flags: int = ..., /
) -> tuple[int, list[_CMSG], int, Any]: ...

def recvfrom_into(self, buffer: WriteableBuffer, nbytes: int = ..., flags: int = ...) -> tuple[int, _RetAddress]: ...
def recv_into(self, buffer: WriteableBuffer, nbytes: int = ..., flags: int = ...) -> int: ...
Expand All @@ -737,7 +737,8 @@ class socket:
ancdata: Iterable[_CMSGArg] = ...,
flags: int = ...,
address: _Address | None = ...,
/) -> int: ...
/,
) -> int: ...
if sys.platform == "linux":
def sendmsg_afalg(
self, msg: Iterable[ReadableBuffer] = ..., *, op: int, iv: Any = ..., assoclen: int = ..., flags: int = ...
Expand Down
3 changes: 2 additions & 1 deletion stdlib/_tkinter.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ def create(
wantTk: bool = True,
sync: bool = False,
use: str | None = None,
/): ...
/,
): ...
def getbusywaitinterval(): ...
def setbusywaitinterval(new_val, /): ...
4 changes: 2 additions & 2 deletions stdlib/_typeshed/wsgi.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ else:
# stable
class StartResponse(Protocol):
def __call__(
self, status: str, headers: list[tuple[str, str]], exc_info: OptExcInfo | None = ...,
/) -> Callable[[bytes], object]: ...
self, status: str, headers: list[tuple[str, str]], exc_info: OptExcInfo | None = ..., /
) -> Callable[[bytes], object]: ...

WSGIEnvironment: TypeAlias = dict[str, Any] # stable
WSGIApplication: TypeAlias = Callable[[WSGIEnvironment, StartResponse], Iterable[bytes]] # stable
Expand Down
16 changes: 10 additions & 6 deletions stdlib/_winapi.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ if sys.platform == "win32":
creation_disposition: int,
flags_and_attributes: int,
template_file: int,
/) -> int: ...
/,
) -> int: ...
def CreateJunction(src_path: str, dst_path: str, /) -> None: ...
def CreateNamedPipe(
name: str,
Expand All @@ -184,7 +185,8 @@ if sys.platform == "win32":
in_buffer_size: int,
default_timeout: int,
security_attributes: int,
/) -> int: ...
/,
) -> int: ...
def CreatePipe(pipe_attrs: Any, size: int, /) -> tuple[int, int]: ...
def CreateProcess(
application_name: str | None,
Expand All @@ -196,15 +198,17 @@ if sys.platform == "win32":
env_mapping: dict[str, str],
current_directory: str | None,
startup_info: Any,
/) -> tuple[int, int, int, int]: ...
/,
) -> tuple[int, int, int, int]: ...
def DuplicateHandle(
source_process_handle: int,
source_handle: int,
target_process_handle: int,
desired_access: int,
inherit_handle: bool,
options: int = 0,
/) -> int: ...
/,
) -> int: ...
def ExitProcess(ExitCode: int, /) -> NoReturn: ...
def GetACP() -> int: ...
def GetFileType(handle: int) -> int: ...
Expand All @@ -227,8 +231,8 @@ if sys.platform == "win32":
@overload
def ReadFile(handle: int, size: int, overlapped: int | bool) -> tuple[Any, int]: ...
def SetNamedPipeHandleState(
named_pipe: int, mode: int | None, max_collection_count: int | None, collect_data_timeout: int | None,
/) -> None: ...
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 = 0xFFFFFFFF, /) -> int: ...
def WaitForSingleObject(handle: int, milliseconds: int, /) -> int: ...
Expand Down
8 changes: 4 additions & 4 deletions stdlib/array.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ class array(MutableSequence[_T]):
def __init__(self: array[int], typecode: _IntTypeCode, initializer: bytes | bytearray | Iterable[int] = ..., /) -> None: ...
@overload
def __init__(
self: array[float], typecode: _FloatTypeCode, initializer: bytes | bytearray | Iterable[float] = ...,
/) -> None: ...
self: array[float], typecode: _FloatTypeCode, initializer: bytes | bytearray | Iterable[float] = ..., /
) -> None: ...
@overload
def __init__(
self: array[str], typecode: _UnicodeTypeCode, initializer: bytes | bytearray | Iterable[str] = ...,
/) -> None: ...
self: array[str], typecode: _UnicodeTypeCode, initializer: bytes | bytearray | Iterable[str] = ..., /
) -> None: ...
@overload
def __init__(self, typecode: str, initializer: Iterable[_T], /) -> None: ...
@overload
Expand Down
4 changes: 1 addition & 3 deletions stdlib/asyncio/events.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,7 @@ _ProtocolFactory: TypeAlias = Callable[[], BaseProtocol]
_SSLContext: TypeAlias = bool | None | ssl.SSLContext

class _TaskFactory(Protocol):
def __call__(
self, loop: AbstractEventLoop, factory: Coroutine[Any, Any, _T] | Generator[Any, None, _T],
/) -> Future[_T]: ...
def __call__(self, loop: AbstractEventLoop, factory: Coroutine[Any, Any, _T] | Generator[Any, None, _T], /) -> Future[_T]: ...

class Handle:
_cancelled: bool
Expand Down
54 changes: 36 additions & 18 deletions stdlib/asyncio/tasks.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,8 @@ if sys.version_info >= (3, 10):
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
/, *,
/,
*,
return_exceptions: Literal[False] = False,
) -> Future[tuple[_T1, _T2, _T3]]: ...
@overload
Expand All @@ -117,7 +118,8 @@ if sys.version_info >= (3, 10):
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
coro_or_future4: _FutureLike[_T4],
/, *,
/,
*,
return_exceptions: Literal[False] = False,
) -> Future[tuple[_T1, _T2, _T3, _T4]]: ...
@overload
Expand All @@ -127,7 +129,8 @@ if sys.version_info >= (3, 10):
coro_or_future3: _FutureLike[_T3],
coro_or_future4: _FutureLike[_T4],
coro_or_future5: _FutureLike[_T5],
/, *,
/,
*,
return_exceptions: Literal[False] = False,
) -> Future[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
@overload
Expand All @@ -138,7 +141,8 @@ if sys.version_info >= (3, 10):
coro_or_future4: _FutureLike[_T4],
coro_or_future5: _FutureLike[_T5],
coro_or_future6: _FutureLike[_T6],
/, *,
/,
*,
return_exceptions: Literal[False] = False,
) -> Future[tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ...
@overload
Expand All @@ -154,7 +158,8 @@ if sys.version_info >= (3, 10):
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
/, *,
/,
*,
return_exceptions: bool,
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException]]: ...
@overload
Expand All @@ -163,7 +168,8 @@ if sys.version_info >= (3, 10):
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
coro_or_future4: _FutureLike[_T4],
/, *,
/,
*,
return_exceptions: bool,
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException]]: ...
@overload
Expand All @@ -173,7 +179,8 @@ if sys.version_info >= (3, 10):
coro_or_future3: _FutureLike[_T3],
coro_or_future4: _FutureLike[_T4],
coro_or_future5: _FutureLike[_T5],
/, *,
/,
*,
return_exceptions: bool,
) -> Future[
tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException, _T5 | BaseException]
Expand All @@ -186,7 +193,8 @@ if sys.version_info >= (3, 10):
coro_or_future4: _FutureLike[_T4],
coro_or_future5: _FutureLike[_T5],
coro_or_future6: _FutureLike[_T6],
/, *,
/,
*,
return_exceptions: bool,
) -> Future[
tuple[
Expand All @@ -210,7 +218,8 @@ else:
def gather( # type: ignore[overload-overlap]
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
/, *,
/,
*,
loop: AbstractEventLoop | None = None,
return_exceptions: Literal[False] = False,
) -> Future[tuple[_T1, _T2]]: ...
Expand All @@ -219,7 +228,8 @@ else:
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
/, *,
/,
*,
loop: AbstractEventLoop | None = None,
return_exceptions: Literal[False] = False,
) -> Future[tuple[_T1, _T2, _T3]]: ...
Expand All @@ -229,7 +239,8 @@ else:
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
coro_or_future4: _FutureLike[_T4],
/, *,
/,
*,
loop: AbstractEventLoop | None = None,
return_exceptions: Literal[False] = False,
) -> Future[tuple[_T1, _T2, _T3, _T4]]: ...
Expand All @@ -240,7 +251,8 @@ else:
coro_or_future3: _FutureLike[_T3],
coro_or_future4: _FutureLike[_T4],
coro_or_future5: _FutureLike[_T5],
/, *,
/,
*,
loop: AbstractEventLoop | None = None,
return_exceptions: Literal[False] = False,
) -> Future[tuple[_T1, _T2, _T3, _T4, _T5]]: ...
Expand All @@ -252,7 +264,8 @@ else:
coro_or_future4: _FutureLike[_T4],
coro_or_future5: _FutureLike[_T5],
coro_or_future6: _FutureLike[_T6],
/, *,
/,
*,
loop: AbstractEventLoop | None = None,
return_exceptions: Literal[False] = False,
) -> Future[tuple[_T1, _T2, _T3, _T4, _T5, _T6]]: ...
Expand All @@ -268,7 +281,8 @@ else:
def gather( # type: ignore[overload-overlap]
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
/, *,
/,
*,
loop: AbstractEventLoop | None = None,
return_exceptions: bool,
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException]]: ...
Expand All @@ -277,7 +291,8 @@ else:
coro_or_future1: _FutureLike[_T1],
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
/, *,
/,
*,
loop: AbstractEventLoop | None = None,
return_exceptions: bool,
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException]]: ...
Expand All @@ -287,7 +302,8 @@ else:
coro_or_future2: _FutureLike[_T2],
coro_or_future3: _FutureLike[_T3],
coro_or_future4: _FutureLike[_T4],
/, *,
/,
*,
loop: AbstractEventLoop | None = None,
return_exceptions: bool,
) -> Future[tuple[_T1 | BaseException, _T2 | BaseException, _T3 | BaseException, _T4 | BaseException]]: ...
Expand All @@ -299,7 +315,8 @@ else:
coro_or_future4: _FutureLike[_T4],
coro_or_future5: _FutureLike[_T5],
coro_or_future6: _FutureLike[_T6],
/, *,
/,
*,
loop: AbstractEventLoop | None = None,
return_exceptions: bool,
) -> Future[
Expand Down Expand Up @@ -447,7 +464,8 @@ if sys.version_info >= (3, 12):
def __call__(
self,
coro: _TaskCompatibleCoro[Any],
/, *,
/,
*,
loop: AbstractEventLoop,
name: str | None,
context: Context | None,
Expand Down
Loading

0 comments on commit db218ce

Please sign in to comment.