Enable pyright for all Python 3 stubs (#5597)

* pyright: disable reportUnknownParameterType

Unknown parameter types are preferred over Any annotations for
incomplete stubs. Especially larger stubs are expected to be
incomplete for some time and it would be a shame to lose the
other pyright warnings for those stubs.

* Also disable reportUnknownVariableType

Fix problems with tkinter

* Disable reportUnknownMemberType

Fix pyright problems
This commit is contained in:
Sebastian Rittau
2021-06-09 16:14:22 +02:00
committed by GitHub
parent c601d5cf3d
commit 711580722b
78 changed files with 633 additions and 687 deletions

View File

@@ -1,4 +1,4 @@
from socket import socket
from socket import socket as _socket
from typing import Any, AnyStr, Mapping, Optional, Tuple, Type
from .charset import charset_by_id as charset_by_id, charset_by_name as charset_by_name
@@ -88,7 +88,7 @@ class Connection:
cursorclass: Optional[Type[Cursor]] = ...,
init_command: Optional[Any] = ...,
connect_timeout: Optional[int] = ...,
ssl: Optional[Mapping] = ...,
ssl: Mapping[Any, Any] | None = ...,
read_default_group: Optional[Any] = ...,
compress: Optional[Any] = ...,
named_pipe: Optional[Any] = ...,
@@ -98,7 +98,7 @@ class Connection:
local_infile: Optional[Any] = ...,
max_allowed_packet: int = ...,
defer_connect: Optional[bool] = ...,
auth_plugin_map: Optional[Mapping] = ...,
auth_plugin_map: Mapping[Any, Any] | None = ...,
read_timeout: Optional[float] = ...,
write_timeout: Optional[float] = ...,
bind_address: Optional[Any] = ...,
@@ -118,7 +118,7 @@ class Connection:
def begin(self) -> None: ...
def rollback(self) -> None: ...
def select_db(self, db) -> None: ...
def escape(self, obj, mapping: Optional[Mapping] = ...): ...
def escape(self, obj, mapping: Mapping[Any, Any] | None = ...): ...
def literal(self, obj): ...
def escape_string(self, s: AnyStr) -> AnyStr: ...
def cursor(self, cursor: Optional[Type[Cursor]] = ...) -> Cursor: ...
@@ -128,7 +128,7 @@ class Connection:
def kill(self, thread_id): ...
def ping(self, reconnect: bool = ...) -> None: ...
def set_charset(self, charset) -> None: ...
def connect(self, sock: Optional[socket] = ...) -> None: ...
def connect(self, sock: Optional[_socket] = ...) -> None: ...
def write_packet(self, payload) -> None: ...
def _read_packet(self, packet_type=...): ...
def insert_id(self): ...