Skip to content

Commit

Permalink
Sync typeshed (#13900)
Browse files Browse the repository at this point in the history
Sync typeshed

Source commit:

python/typeshed@51e18a8

Note that you will need to close and re-open the PR in order to trigger
CI.

Co-authored-by: mypybot <>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
  • Loading branch information
github-actions[bot] and hauntsaninja committed Oct 15, 2022
1 parent d528bf2 commit abc9d15
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 22 deletions.
2 changes: 1 addition & 1 deletion mypy/typeshed/stdlib/asyncio/transports.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class SubprocessTransport(BaseTransport):
def get_pid(self) -> int: ...
def get_returncode(self) -> int | None: ...
def get_pipe_transport(self, fd: int) -> BaseTransport | None: ...
def send_signal(self, signal: int) -> int: ...
def send_signal(self, signal: int) -> None: ...
def terminate(self) -> None: ...
def kill(self) -> None: ...

Expand Down
9 changes: 3 additions & 6 deletions mypy/typeshed/stdlib/ctypes/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -165,13 +165,10 @@ class _Pointer(Generic[_CT], _PointerLike, _CData):
@overload
def __init__(self, arg: _CT) -> None: ...
@overload
def __getitem__(self, __i: int) -> _CT: ...
@overload
def __getitem__(self, __s: slice) -> list[_CT]: ...
@overload
def __setitem__(self, __i: int, __o: _CT) -> None: ...
def __getitem__(self, __i: int) -> Any: ...
@overload
def __setitem__(self, __s: slice, __o: Iterable[_CT]) -> None: ...
def __getitem__(self, __s: slice) -> list[Any]: ...
def __setitem__(self, __i: int, __o: Any) -> None: ...

def pointer(__arg: _CT) -> _Pointer[_CT]: ...
def resize(obj: _CData, size: int) -> None: ...
Expand Down
3 changes: 2 additions & 1 deletion mypy/typeshed/stdlib/pydoc.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ from collections.abc import Callable, Container, Mapping, MutableMapping
from reprlib import Repr
from types import MethodType, ModuleType, TracebackType
from typing import IO, Any, AnyStr, NoReturn, TypeVar
from typing_extensions import TypeGuard

__all__ = ["help"]

Expand Down Expand Up @@ -231,5 +232,5 @@ class ModuleScanner:
) -> None: ...

def apropos(key: str) -> None: ...
def ispath(x: Any) -> bool: ...
def ispath(x: object) -> TypeGuard[str]: ...
def cli() -> None: ...
4 changes: 2 additions & 2 deletions mypy/typeshed/stdlib/subprocess.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -1828,8 +1828,8 @@ class TimeoutExpired(SubprocessError):
timeout: float
# morally: _TXT | None
output: Any
stdout: Any
stderr: Any
stdout: bytes | None
stderr: bytes | None

class CalledProcessError(SubprocessError):
returncode: int
Expand Down
27 changes: 15 additions & 12 deletions mypy/typeshed/stdlib/urllib/parse.pyi
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import sys
from collections.abc import Callable, Mapping, Sequence
from typing import Any, AnyStr, Generic, NamedTuple, overload
from typing_extensions import TypeAlias

if sys.version_info >= (3, 9):
from types import GenericAlias
Expand Down Expand Up @@ -30,8 +29,6 @@ __all__ = [
"SplitResultBytes",
]

_Str: TypeAlias = bytes | str

uses_relative: list[str]
uses_netloc: list[str]
uses_params: list[str]
Expand Down Expand Up @@ -135,16 +132,22 @@ def parse_qsl(
separator: str = ...,
) -> list[tuple[AnyStr, AnyStr]]: ...
@overload
def quote(string: str, safe: _Str = ..., encoding: str | None = ..., errors: str | None = ...) -> str: ...
def quote(string: str, safe: str | bytes = ..., encoding: str | None = ..., errors: str | None = ...) -> str: ...
@overload
def quote(string: bytes, safe: _Str = ...) -> str: ...
def quote_from_bytes(bs: bytes, safe: _Str = ...) -> str: ...
def quote(string: bytes, safe: str | bytes = ...) -> str: ...
def quote_from_bytes(bs: bytes, safe: str | bytes = ...) -> str: ...
@overload
def quote_plus(string: str, safe: _Str = ..., encoding: str | None = ..., errors: str | None = ...) -> str: ...
def quote_plus(string: str, safe: str | bytes = ..., encoding: str | None = ..., errors: str | None = ...) -> str: ...
@overload
def quote_plus(string: bytes, safe: _Str = ...) -> str: ...
def unquote(string: str, encoding: str = ..., errors: str = ...) -> str: ...
def unquote_to_bytes(string: _Str) -> bytes: ...
def quote_plus(string: bytes, safe: str | bytes = ...) -> str: ...

if sys.version_info >= (3, 9):
def unquote(string: str | bytes, encoding: str = ..., errors: str = ...) -> str: ...

else:
def unquote(string: str, encoding: str = ..., errors: str = ...) -> str: ...

def unquote_to_bytes(string: str | bytes) -> bytes: ...
def unquote_plus(string: str, encoding: str = ..., errors: str = ...) -> str: ...
@overload
def urldefrag(url: str) -> DefragResult: ...
Expand All @@ -153,10 +156,10 @@ def urldefrag(url: bytes | None) -> DefragResultBytes: ...
def urlencode(
query: Mapping[Any, Any] | Mapping[Any, Sequence[Any]] | Sequence[tuple[Any, Any]] | Sequence[tuple[Any, Sequence[Any]]],
doseq: bool = ...,
safe: _Str = ...,
safe: str | bytes = ...,
encoding: str = ...,
errors: str = ...,
quote_via: Callable[[AnyStr, _Str, str, str], str] = ...,
quote_via: Callable[[AnyStr, str | bytes, str, str], str] = ...,
) -> str: ...
def urljoin(base: AnyStr, url: AnyStr | None, allow_fragments: bool = ...) -> AnyStr: ...
@overload
Expand Down

0 comments on commit abc9d15

Please sign in to comment.