mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 13:04:46 +08:00
Use lowercase type everywhere (#6853)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from socket import socket as _socket
|
||||
from typing import Any, AnyStr, Generic, Mapping, Type, TypeVar, overload
|
||||
from typing import Any, AnyStr, Generic, Mapping, TypeVar, overload
|
||||
|
||||
from .charset import charset_by_id as charset_by_id, charset_by_name as charset_by_name
|
||||
from .constants import CLIENT as CLIENT, COMMAND as COMMAND, FIELD_TYPE as FIELD_TYPE, SERVER_STATUS as SERVER_STATUS
|
||||
@@ -133,7 +133,7 @@ class Connection(Generic[_C]):
|
||||
conv=...,
|
||||
use_unicode: bool | None = ...,
|
||||
client_flag: int = ...,
|
||||
cursorclass: Type[_C] = ..., # different between overloads
|
||||
cursorclass: type[_C] = ..., # different between overloads
|
||||
init_command: Any | None = ...,
|
||||
connect_timeout: int | None = ...,
|
||||
ssl: Mapping[Any, Any] | None = ...,
|
||||
@@ -178,7 +178,7 @@ class Connection(Generic[_C]):
|
||||
@overload
|
||||
def cursor(self, cursor: None = ...) -> _C: ...
|
||||
@overload
|
||||
def cursor(self, cursor: Type[_C2]) -> _C2: ...
|
||||
def cursor(self, cursor: type[_C2]) -> _C2: ...
|
||||
def query(self, sql, unbuffered: bool = ...) -> int: ...
|
||||
def next_result(self, unbuffered: bool = ...) -> int: ...
|
||||
def affected_rows(self): ...
|
||||
|
||||
@@ -2,9 +2,9 @@ import datetime
|
||||
import time
|
||||
from collections.abc import Callable, Mapping, Sequence
|
||||
from decimal import Decimal
|
||||
from typing import Any, Optional, Type, TypeVar
|
||||
from typing import Any, Optional, TypeVar
|
||||
|
||||
_EscaperMapping = Optional[Mapping[Type[object], Callable[..., str]]]
|
||||
_EscaperMapping = Optional[Mapping[type[object], Callable[..., str]]]
|
||||
_T = TypeVar("_T")
|
||||
|
||||
def escape_item(val: object, charset: object, mapping: _EscaperMapping = ...) -> str: ...
|
||||
@@ -33,7 +33,7 @@ def through(x: _T) -> _T: ...
|
||||
|
||||
convert_bit = through
|
||||
|
||||
encoders: dict[Type[object], Callable[..., str]]
|
||||
encoders: dict[type[object], Callable[..., str]]
|
||||
decoders: dict[int, Callable[[str | bytes], Any]]
|
||||
conversions: dict[Type[object] | int, Callable[..., Any]]
|
||||
conversions: dict[type[object] | int, Callable[..., Any]]
|
||||
Thing2Literal = escape_str
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import builtins
|
||||
from typing import NoReturn, Type
|
||||
from typing import NoReturn
|
||||
|
||||
from .constants import ER as ER
|
||||
|
||||
@@ -15,6 +15,6 @@ class InternalError(DatabaseError): ...
|
||||
class ProgrammingError(DatabaseError): ...
|
||||
class NotSupportedError(DatabaseError): ...
|
||||
|
||||
error_map: dict[int, Type[DatabaseError]]
|
||||
error_map: dict[int, type[DatabaseError]]
|
||||
|
||||
def raise_mysql_exception(data) -> NoReturn: ...
|
||||
|
||||
Reference in New Issue
Block a user