mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 14:01:55 +08:00
Use PEP 585 syntax in Python 2, protobuf & _ast stubs, where possible (#6949)
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
from datetime import date, datetime, time
|
||||
from typing import Any, Callable, Generator, Iterable, Iterator, List, Protocol, Text, Tuple, Type, TypeVar
|
||||
from typing import Any, Callable, Generator, Iterable, Iterator, Protocol, Text, TypeVar
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
@@ -14,8 +14,8 @@ def DateFromTicks(ticks: float) -> Date: ...
|
||||
def TimeFromTicks(ticks: float) -> Time: ...
|
||||
def TimestampFromTicks(ticks: float) -> Timestamp: ...
|
||||
|
||||
version_info: Tuple[int, int, int]
|
||||
sqlite_version_info: Tuple[int, int, int]
|
||||
version_info: tuple[int, int, int]
|
||||
sqlite_version_info: tuple[int, int, int]
|
||||
Binary = buffer
|
||||
|
||||
# The remaining definitions are imported from _sqlite3.
|
||||
@@ -67,12 +67,12 @@ def connect(
|
||||
detect_types: int = ...,
|
||||
isolation_level: str | None = ...,
|
||||
check_same_thread: bool = ...,
|
||||
factory: Type[Connection] | None = ...,
|
||||
factory: type[Connection] | None = ...,
|
||||
cached_statements: int = ...,
|
||||
) -> Connection: ...
|
||||
def enable_callback_tracebacks(__enable: bool) -> None: ...
|
||||
def enable_shared_cache(enable: int) -> None: ...
|
||||
def register_adapter(__type: Type[_T], __caster: Callable[[_T], int | float | str | bytes]) -> None: ...
|
||||
def register_adapter(__type: type[_T], __caster: Callable[[_T], int | float | str | bytes]) -> None: ...
|
||||
def register_converter(__name: str, __converter: Callable[[bytes], Any]) -> None: ...
|
||||
|
||||
class Cache(object):
|
||||
@@ -144,8 +144,8 @@ class Cursor(Iterator[Any]):
|
||||
def execute(self, __sql: str, __parameters: Iterable[Any] = ...) -> Cursor: ...
|
||||
def executemany(self, __sql: str, __seq_of_parameters: Iterable[Iterable[Any]]) -> Cursor: ...
|
||||
def executescript(self, __sql_script: bytes | Text) -> Cursor: ...
|
||||
def fetchall(self) -> List[Any]: ...
|
||||
def fetchmany(self, size: int | None = ...) -> List[Any]: ...
|
||||
def fetchall(self) -> list[Any]: ...
|
||||
def fetchmany(self, size: int | None = ...) -> list[Any]: ...
|
||||
def fetchone(self) -> Any: ...
|
||||
def setinputsizes(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
def setoutputsize(self, *args: Any, **kwargs: Any) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user