mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Bump black to 23.1.0 (#9647)
This commit is contained in:
@@ -16,7 +16,7 @@ repos:
|
||||
- id: pycln
|
||||
args: [--config=pyproject.toml, stubs, stdlib, tests, scripts]
|
||||
- repo: https://github.com/psf/black
|
||||
rev: 22.12.0 # must match requirements-tests.txt
|
||||
rev: 23.1.0 # must match requirements-tests.txt
|
||||
hooks:
|
||||
- id: black
|
||||
language_version: python3.10
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
aiohttp==3.8.3
|
||||
black==22.12.0 # must match .pre-commit-config.yaml
|
||||
black==23.1.0 # must match .pre-commit-config.yaml
|
||||
flake8==6.0.0; python_version >= "3.8" # must match .pre-commit-config.yaml
|
||||
flake8-bugbear==23.1.14; python_version >= "3.8" # must match .pre-commit-config.yaml
|
||||
flake8-noqa==1.3.0; python_version >= "3.8" # must match .pre-commit-config.yaml
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import sys
|
||||
|
||||
if sys.platform == "win32":
|
||||
|
||||
# Actual typename View, not exposed by the implementation
|
||||
class _View:
|
||||
def Execute(self, params: _Record | None = ...) -> None: ...
|
||||
@@ -12,6 +11,7 @@ if sys.platform == "win32":
|
||||
# Don't exist at runtime
|
||||
__new__: None # type: ignore[assignment]
|
||||
__init__: None # type: ignore[assignment]
|
||||
|
||||
# Actual typename SummaryInformation, not exposed by the implementation
|
||||
class _SummaryInformation:
|
||||
def GetProperty(self, field: int) -> int | bytes | None: ...
|
||||
@@ -21,6 +21,7 @@ if sys.platform == "win32":
|
||||
# Don't exist at runtime
|
||||
__new__: None # type: ignore[assignment]
|
||||
__init__: None # type: ignore[assignment]
|
||||
|
||||
# Actual typename Database, not exposed by the implementation
|
||||
class _Database:
|
||||
def OpenView(self, sql: str) -> _View: ...
|
||||
@@ -30,6 +31,7 @@ if sys.platform == "win32":
|
||||
# Don't exist at runtime
|
||||
__new__: None # type: ignore[assignment]
|
||||
__init__: None # type: ignore[assignment]
|
||||
|
||||
# Actual typename Record, not exposed by the implementation
|
||||
class _Record:
|
||||
def GetFieldCount(self) -> int: ...
|
||||
|
||||
@@ -9,7 +9,6 @@ from . import events, futures, protocols, transports
|
||||
_File: TypeAlias = int | IO[Any] | None
|
||||
|
||||
class BaseSubprocessTransport(transports.SubprocessTransport):
|
||||
|
||||
_closed: bool # undocumented
|
||||
_protocol: protocols.SubprocessProtocol # undocumented
|
||||
_loop: events.AbstractEventLoop # undocumented
|
||||
|
||||
@@ -57,7 +57,6 @@ class _ProactorWritePipeTransport(_ProactorBaseWritePipeTransport): ...
|
||||
class _ProactorDuplexPipeTransport(_ProactorReadPipeTransport, _ProactorBaseWritePipeTransport, transports.Transport): ...
|
||||
|
||||
class _ProactorSocketTransport(_ProactorReadPipeTransport, _ProactorBaseWritePipeTransport, transports.Transport):
|
||||
|
||||
_sendfile_compatible: ClassVar[constants._SendfileMode]
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
@@ -35,7 +35,6 @@ else:
|
||||
|
||||
if sys.version_info < (3, 11):
|
||||
class _SSLPipe:
|
||||
|
||||
max_size: ClassVar[int]
|
||||
|
||||
_context: ssl.SSLContext
|
||||
@@ -64,7 +63,6 @@ if sys.version_info < (3, 11):
|
||||
def feed_appdata(self, data: bytes, offset: int = 0) -> tuple[list[bytes], int]: ...
|
||||
|
||||
class _SSLProtocolTransport(transports._FlowControlMixin, transports.Transport):
|
||||
|
||||
_sendfile_compatible: ClassVar[constants._SendfileMode]
|
||||
|
||||
_loop: events.AbstractEventLoop
|
||||
|
||||
@@ -85,7 +85,6 @@ if sys.platform != "win32":
|
||||
DefaultEventLoopPolicy = _UnixDefaultEventLoopPolicy
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
|
||||
from typing import Protocol
|
||||
|
||||
class _Warn(Protocol):
|
||||
|
||||
@@ -25,7 +25,6 @@ def loop(timeout: float = 30.0, use_poll: bool = False, map: _MapType | None = N
|
||||
# Not really subclass of socket.socket; it's only delegation.
|
||||
# It is not covariant to it.
|
||||
class dispatcher:
|
||||
|
||||
debug: bool
|
||||
connected: bool
|
||||
accepting: bool
|
||||
|
||||
@@ -70,7 +70,6 @@ class Bdb:
|
||||
def runcall(self, __func: Callable[_P, _T], *args: _P.args, **kwds: _P.kwargs) -> _T | None: ...
|
||||
|
||||
class Breakpoint:
|
||||
|
||||
next: int
|
||||
bplist: dict[tuple[str, int], list[Breakpoint]]
|
||||
bpbynumber: list[Breakpoint | None]
|
||||
|
||||
@@ -63,7 +63,7 @@ else:
|
||||
def lru_cache(maxsize: int | None = 128, typed: bool = False) -> Callable[[Callable[..., _T]], _lru_cache_wrapper[_T]]: ...
|
||||
|
||||
WRAPPER_ASSIGNMENTS: tuple[
|
||||
Literal["__module__"], Literal["__name__"], Literal["__qualname__"], Literal["__doc__"], Literal["__annotations__"],
|
||||
Literal["__module__"], Literal["__name__"], Literal["__qualname__"], Literal["__doc__"], Literal["__annotations__"]
|
||||
]
|
||||
WRAPPER_UPDATES: tuple[Literal["__dict__"]]
|
||||
|
||||
|
||||
@@ -105,7 +105,6 @@ class Mailbox(Generic[_MessageT]):
|
||||
def __class_getitem__(cls, item: Any) -> GenericAlias: ...
|
||||
|
||||
class Maildir(Mailbox[MaildirMessage]):
|
||||
|
||||
colon: str
|
||||
def __init__(
|
||||
self, dirname: StrPath, factory: Callable[[IO[Any]], MaildirMessage] | None = None, create: bool = True
|
||||
|
||||
@@ -23,7 +23,6 @@ class Module: # undocumented
|
||||
def __init__(self, name: str, file: str | None = None, path: str | None = None) -> None: ...
|
||||
|
||||
class ModuleFinder:
|
||||
|
||||
modules: dict[str, Module]
|
||||
path: list[str] # undocumented
|
||||
badmodules: dict[str, dict[str, int]] # undocumented
|
||||
|
||||
@@ -24,7 +24,6 @@ if sys.platform == "win32":
|
||||
knownbits: Literal[0x3FFF]
|
||||
|
||||
class Table:
|
||||
|
||||
name: str
|
||||
fields: list[tuple[int, str, int]]
|
||||
def __init__(self, name: str) -> None: ...
|
||||
@@ -50,7 +49,6 @@ if sys.platform == "win32":
|
||||
def gen_uuid() -> str: ...
|
||||
|
||||
class CAB:
|
||||
|
||||
name: str
|
||||
files: list[tuple[str, str]]
|
||||
filenames: set[str]
|
||||
@@ -62,7 +60,6 @@ if sys.platform == "win32":
|
||||
_directories: set[str]
|
||||
|
||||
class Directory:
|
||||
|
||||
db: _Database
|
||||
cab: CAB
|
||||
basedir: str
|
||||
@@ -98,12 +95,10 @@ if sys.platform == "win32":
|
||||
def remove_pyc(self) -> None: ...
|
||||
|
||||
class Binary:
|
||||
|
||||
name: str
|
||||
def __init__(self, fname: str) -> None: ...
|
||||
|
||||
class Feature:
|
||||
|
||||
id: str
|
||||
def __init__(
|
||||
self,
|
||||
@@ -120,7 +115,6 @@ if sys.platform == "win32":
|
||||
def set_current(self) -> None: ...
|
||||
|
||||
class Control:
|
||||
|
||||
dlg: Dialog
|
||||
name: str
|
||||
def __init__(self, dlg: Dialog, name: str) -> None: ...
|
||||
@@ -129,14 +123,12 @@ if sys.platform == "win32":
|
||||
def condition(self, action: str, condition: str) -> None: ...
|
||||
|
||||
class RadioButtonGroup(Control):
|
||||
|
||||
property: str
|
||||
index: int
|
||||
def __init__(self, dlg: Dialog, name: str, property: str) -> None: ...
|
||||
def add(self, name: str, x: int, y: int, w: int, h: int, text: str, value: str | None = None) -> None: ...
|
||||
|
||||
class Dialog:
|
||||
|
||||
db: _Database
|
||||
name: str
|
||||
x: int
|
||||
|
||||
@@ -2,7 +2,6 @@ import sys
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
if sys.platform == "win32":
|
||||
|
||||
_SequenceType: TypeAlias = list[tuple[str, str | None, int]]
|
||||
|
||||
AdminExecuteSequence: _SequenceType
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import sys
|
||||
|
||||
if sys.platform == "win32":
|
||||
|
||||
ActionText: list[tuple[str, str, str | None]]
|
||||
UIText: list[tuple[str, str | None]]
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@ INTERNAL_ERROR: int # undocumented
|
||||
class Error(Exception): ...
|
||||
|
||||
class ProtocolError(Error):
|
||||
|
||||
url: str
|
||||
errcode: int
|
||||
errmsg: str
|
||||
@@ -65,7 +64,6 @@ class ProtocolError(Error):
|
||||
class ResponseError(Error): ...
|
||||
|
||||
class Fault(Error):
|
||||
|
||||
faultCode: int
|
||||
faultString: str
|
||||
def __init__(self, faultCode: int, faultString: str, **extra: Any) -> None: ...
|
||||
@@ -77,7 +75,6 @@ def _iso8601_format(value: datetime) -> str: ... # undocumented
|
||||
def _strftime(value: _XMLDate) -> str: ... # undocumented
|
||||
|
||||
class DateTime:
|
||||
|
||||
value: str # undocumented
|
||||
def __init__(self, value: int | str | datetime | time.struct_time | tuple[int, ...] = 0) -> None: ...
|
||||
def __lt__(self, other: _DateTimeComparable) -> bool: ...
|
||||
@@ -94,7 +91,6 @@ def _datetime(data: Any) -> DateTime: ... # undocumented
|
||||
def _datetime_type(data: str) -> datetime: ... # undocumented
|
||||
|
||||
class Binary:
|
||||
|
||||
data: bytes
|
||||
def __init__(self, data: bytes | bytearray | None = None) -> None: ...
|
||||
def decode(self, data: ReadableBuffer) -> None: ...
|
||||
@@ -137,7 +133,6 @@ class Marshaller:
|
||||
def dump_instance(self, value: object, write: _WriteCallback) -> None: ...
|
||||
|
||||
class Unmarshaller:
|
||||
|
||||
dispatch: dict[str, Callable[[Unmarshaller, str], None]]
|
||||
|
||||
_type: str | None
|
||||
@@ -174,7 +169,6 @@ class Unmarshaller:
|
||||
def end_methodName(self, data: str) -> None: ...
|
||||
|
||||
class _MultiCallMethod: # undocumented
|
||||
|
||||
__call_list: list[tuple[str, tuple[_Marshallable, ...]]]
|
||||
__name: str
|
||||
def __init__(self, call_list: list[tuple[str, _Marshallable]], name: str) -> None: ...
|
||||
@@ -182,13 +176,11 @@ class _MultiCallMethod: # undocumented
|
||||
def __call__(self, *args: _Marshallable) -> None: ...
|
||||
|
||||
class MultiCallIterator: # undocumented
|
||||
|
||||
results: list[list[_Marshallable]]
|
||||
def __init__(self, results: list[list[_Marshallable]]) -> None: ...
|
||||
def __getitem__(self, i: int) -> _Marshallable: ...
|
||||
|
||||
class MultiCall:
|
||||
|
||||
__server: ServerProxy
|
||||
__call_list: list[tuple[str, tuple[_Marshallable, ...]]]
|
||||
def __init__(self, server: ServerProxy) -> None: ...
|
||||
@@ -215,12 +207,10 @@ def gzip_encode(data: ReadableBuffer) -> bytes: ... # undocumented
|
||||
def gzip_decode(data: ReadableBuffer, max_decode: int = ...) -> bytes: ... # undocumented
|
||||
|
||||
class GzipDecodedResponse(gzip.GzipFile): # undocumented
|
||||
|
||||
io: BytesIO
|
||||
def __init__(self, response: SupportsRead[ReadableBuffer]) -> None: ...
|
||||
|
||||
class _Method: # undocumented
|
||||
|
||||
__send: Callable[[str, tuple[_Marshallable, ...]], _Marshallable]
|
||||
__name: str
|
||||
def __init__(self, send: Callable[[str, tuple[_Marshallable, ...]], _Marshallable], name: str) -> None: ...
|
||||
@@ -228,7 +218,6 @@ class _Method: # undocumented
|
||||
def __call__(self, *args: _Marshallable) -> _Marshallable: ...
|
||||
|
||||
class Transport:
|
||||
|
||||
user_agent: str
|
||||
accept_gzip_encoding: bool
|
||||
encode_threshold: int | None
|
||||
@@ -264,7 +253,6 @@ class Transport:
|
||||
def parse_response(self, response: http.client.HTTPResponse) -> tuple[_Marshallable, ...]: ...
|
||||
|
||||
class SafeTransport(Transport):
|
||||
|
||||
if sys.version_info >= (3, 8):
|
||||
def __init__(
|
||||
self,
|
||||
@@ -282,7 +270,6 @@ class SafeTransport(Transport):
|
||||
def make_connection(self, host: _HostType) -> http.client.HTTPSConnection: ...
|
||||
|
||||
class ServerProxy:
|
||||
|
||||
__host: str
|
||||
__handler: str
|
||||
__transport: Transport
|
||||
|
||||
@@ -36,7 +36,6 @@ def resolve_dotted_attribute(obj: Any, attr: str, allow_dotted_names: bool = Tru
|
||||
def list_public_methods(obj: Any) -> list[str]: ... # undocumented
|
||||
|
||||
class SimpleXMLRPCDispatcher: # undocumented
|
||||
|
||||
funcs: dict[str, _DispatchProtocol]
|
||||
instance: Any | None
|
||||
allow_none: bool
|
||||
@@ -70,7 +69,6 @@ class SimpleXMLRPCRequestHandler(http.server.BaseHTTPRequestHandler):
|
||||
def report_404(self) -> None: ...
|
||||
|
||||
class SimpleXMLRPCServer(socketserver.TCPServer, SimpleXMLRPCDispatcher):
|
||||
|
||||
_send_traceback_handler: bool
|
||||
def __init__(
|
||||
self,
|
||||
@@ -84,7 +82,6 @@ class SimpleXMLRPCServer(socketserver.TCPServer, SimpleXMLRPCDispatcher):
|
||||
) -> None: ...
|
||||
|
||||
class MultiPathXMLRPCServer(SimpleXMLRPCServer): # undocumented
|
||||
|
||||
dispatchers: dict[str, SimpleXMLRPCDispatcher]
|
||||
def __init__(
|
||||
self,
|
||||
@@ -119,7 +116,6 @@ class ServerHTMLDoc(pydoc.HTMLDoc): # undocumented
|
||||
def docserver(self, server_name: str, package_documentation: str, methods: dict[str, str]) -> str: ...
|
||||
|
||||
class XMLRPCDocGenerator: # undocumented
|
||||
|
||||
server_name: str
|
||||
server_documentation: str
|
||||
server_title: str
|
||||
|
||||
@@ -23,7 +23,7 @@ _Size: TypeAlias = tuple[int, int]
|
||||
_Box: TypeAlias = tuple[int, int, int, int]
|
||||
|
||||
_ConversionMatrix: TypeAlias = Union[
|
||||
tuple[float, float, float, float], tuple[float, float, float, float, float, float, float, float, float, float, float, float],
|
||||
tuple[float, float, float, float], tuple[float, float, float, float, float, float, float, float, float, float, float, float]
|
||||
]
|
||||
# `str` values are only accepted if mode="RGB" for an `Image` object
|
||||
# `float` values are only accepted for certain modes such as "F"
|
||||
|
||||
@@ -178,6 +178,7 @@ def pixel(x: int, y: int) -> tuple[int, int, int]: ...
|
||||
def screenshot(imageFilename: StrOrBytesPath | None = None, region: tuple[int, int, int, int] | None = None) -> Image.Image: ...
|
||||
|
||||
grab = screenshot
|
||||
|
||||
# _locateAll_opencv
|
||||
@overload
|
||||
def locateAll(
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import sys
|
||||
|
||||
if sys.platform == "win32":
|
||||
|
||||
from . import win32
|
||||
|
||||
class WinColor:
|
||||
|
||||
@@ -58,7 +58,6 @@ _ValueOrNative: TypeAlias = bool | float | str | Value
|
||||
_ValueOrInt: TypeAlias = Value | int
|
||||
|
||||
class Value:
|
||||
|
||||
address: Value
|
||||
is_optimized_out: bool
|
||||
type: Type
|
||||
@@ -120,7 +119,6 @@ class Value:
|
||||
def lookup_type(name: str, block: Block = ...) -> Type: ...
|
||||
|
||||
class Type:
|
||||
|
||||
alignof: int
|
||||
code: int
|
||||
dynamic: bool
|
||||
@@ -144,7 +142,6 @@ class Type:
|
||||
def optimized_out(self) -> Value: ...
|
||||
|
||||
class Field:
|
||||
|
||||
bitpos: int
|
||||
enumval: int
|
||||
name: str | None
|
||||
@@ -204,7 +201,6 @@ pretty_printers: list[_PrettyPrinterLookupFunction]
|
||||
# Filtering Frames
|
||||
|
||||
class _FrameFilter(Protocol):
|
||||
|
||||
name: str
|
||||
enabled: bool
|
||||
priority: int
|
||||
@@ -507,7 +503,6 @@ def lookup_static_symbol(name: str, domain: int = ...) -> Symbol | None: ...
|
||||
def lookup_static_symbols(name: str, domain: int = ...) -> list[Symbol]: ...
|
||||
|
||||
class Symbol:
|
||||
|
||||
type: Type | None
|
||||
symtab: Symtab
|
||||
line: int
|
||||
@@ -551,7 +546,6 @@ SYMBOL_LOC_COMMON_BLOCK: int
|
||||
# Symbol tables
|
||||
|
||||
class Symtab_and_line:
|
||||
|
||||
symtab: Symtab
|
||||
pc: int
|
||||
last: int
|
||||
@@ -560,7 +554,6 @@ class Symtab_and_line:
|
||||
def is_valid(self) -> bool: ...
|
||||
|
||||
class Symtab:
|
||||
|
||||
filename: str
|
||||
objfile: Objfile
|
||||
producer: str
|
||||
|
||||
@@ -4,7 +4,6 @@ import gdb
|
||||
from gdb import _PrettyPrinterLookupFunction
|
||||
|
||||
class PrettyPrinter:
|
||||
|
||||
name: str
|
||||
subprinters: list[SubPrettyPrinter] | None
|
||||
enabled: bool
|
||||
@@ -13,7 +12,6 @@ class PrettyPrinter:
|
||||
def __call__(self, val: gdb.Value) -> gdb._PrettyPrinter | None: ...
|
||||
|
||||
class SubPrettyPrinter:
|
||||
|
||||
name: str
|
||||
enabled: bool
|
||||
|
||||
|
||||
@@ -6,9 +6,9 @@ version: str
|
||||
|
||||
def global_init(option: int) -> None: ...
|
||||
def global_cleanup() -> None: ...
|
||||
def version_info() -> tuple[
|
||||
int, str, int, str, int, str, int, str, tuple[str, ...], Incomplete | None, int, Incomplete | None
|
||||
]: ...
|
||||
def version_info() -> (
|
||||
tuple[int, str, int, str, int, str, int, str, tuple[str, ...], Incomplete | None, int, Incomplete | None]
|
||||
): ...
|
||||
|
||||
class error(Exception): ...
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ def test_iscoroutinefunction(
|
||||
z: Callable[[str, int], str | Awaitable[bytes]],
|
||||
xx: object,
|
||||
) -> None:
|
||||
|
||||
if iscoroutinefunction(x):
|
||||
assert_type(x, Callable[[str, int], Coroutine[str, int, bytes]])
|
||||
|
||||
|
||||
Reference in New Issue
Block a user