mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-28 22:56:55 +08:00
apply black and isort (#4287)
* apply black and isort * move some type ignores
This commit is contained in:
@@ -3,10 +3,10 @@
|
||||
|
||||
import os
|
||||
import sys
|
||||
from datetime import date, datetime, time
|
||||
from typing import Any, Callable, Generator, Iterable, Iterator, List, Optional, Text, Tuple, Type, TypeVar, Union
|
||||
from datetime import date, time, datetime
|
||||
|
||||
_T = TypeVar('_T')
|
||||
_T = TypeVar("_T")
|
||||
|
||||
paramstyle: str
|
||||
threadsafety: int
|
||||
@@ -71,32 +71,42 @@ version: str
|
||||
# TODO: adapt needs to get probed
|
||||
def adapt(obj, protocol, alternate): ...
|
||||
def complete_statement(sql: str) -> bool: ...
|
||||
|
||||
if sys.version_info >= (3, 7):
|
||||
def connect(database: Union[bytes, Text, os.PathLike[Text]],
|
||||
timeout: float = ...,
|
||||
detect_types: int = ...,
|
||||
isolation_level: Optional[str] = ...,
|
||||
check_same_thread: bool = ...,
|
||||
factory: Optional[Type[Connection]] = ...,
|
||||
cached_statements: int = ...,
|
||||
uri: bool = ...) -> Connection: ...
|
||||
def connect(
|
||||
database: Union[bytes, Text, os.PathLike[Text]],
|
||||
timeout: float = ...,
|
||||
detect_types: int = ...,
|
||||
isolation_level: Optional[str] = ...,
|
||||
check_same_thread: bool = ...,
|
||||
factory: Optional[Type[Connection]] = ...,
|
||||
cached_statements: int = ...,
|
||||
uri: bool = ...,
|
||||
) -> Connection: ...
|
||||
|
||||
elif sys.version_info >= (3, 4):
|
||||
def connect(database: Union[bytes, Text],
|
||||
timeout: float = ...,
|
||||
detect_types: int = ...,
|
||||
isolation_level: Optional[str] = ...,
|
||||
check_same_thread: bool = ...,
|
||||
factory: Optional[Type[Connection]] = ...,
|
||||
cached_statements: int = ...,
|
||||
uri: bool = ...) -> Connection: ...
|
||||
def connect(
|
||||
database: Union[bytes, Text],
|
||||
timeout: float = ...,
|
||||
detect_types: int = ...,
|
||||
isolation_level: Optional[str] = ...,
|
||||
check_same_thread: bool = ...,
|
||||
factory: Optional[Type[Connection]] = ...,
|
||||
cached_statements: int = ...,
|
||||
uri: bool = ...,
|
||||
) -> Connection: ...
|
||||
|
||||
else:
|
||||
def connect(database: Union[bytes, Text],
|
||||
timeout: float = ...,
|
||||
detect_types: int = ...,
|
||||
isolation_level: Optional[str] = ...,
|
||||
check_same_thread: bool = ...,
|
||||
factory: Optional[Type[Connection]] = ...,
|
||||
cached_statements: int = ...) -> Connection: ...
|
||||
def connect(
|
||||
database: Union[bytes, Text],
|
||||
timeout: float = ...,
|
||||
detect_types: int = ...,
|
||||
isolation_level: Optional[str] = ...,
|
||||
check_same_thread: bool = ...,
|
||||
factory: Optional[Type[Connection]] = ...,
|
||||
cached_statements: int = ...,
|
||||
) -> Connection: ...
|
||||
|
||||
def enable_callback_tracebacks(flag: bool) -> None: ...
|
||||
def enable_shared_cache(do_enable: int) -> None: ...
|
||||
def register_adapter(type: Type[_T], callable: Callable[[_T], Union[int, float, str, bytes]]) -> None: ...
|
||||
@@ -153,9 +163,15 @@ class Connection(object):
|
||||
def enable_load_extension(self, enabled: bool) -> None: ...
|
||||
def load_extension(self, path: str) -> None: ...
|
||||
if sys.version_info >= (3, 7):
|
||||
def backup(self, target: Connection, *, pages: int = ...,
|
||||
progress: Optional[Callable[[int, int, int], object]] = ..., name: str = ...,
|
||||
sleep: float = ...) -> None: ...
|
||||
def backup(
|
||||
self,
|
||||
target: Connection,
|
||||
*,
|
||||
pages: int = ...,
|
||||
progress: Optional[Callable[[int, int, int], object]] = ...,
|
||||
name: str = ...,
|
||||
sleep: float = ...,
|
||||
) -> None: ...
|
||||
def __call__(self, *args, **kwargs): ...
|
||||
def __enter__(self, *args, **kwargs) -> Connection: ...
|
||||
def __exit__(self, *args, **kwargs): ...
|
||||
@@ -186,21 +202,13 @@ class Cursor(Iterator[Any]):
|
||||
else:
|
||||
def next(self) -> Any: ...
|
||||
|
||||
|
||||
class DataError(DatabaseError): ...
|
||||
|
||||
class DatabaseError(Error): ...
|
||||
|
||||
class Error(Exception): ...
|
||||
|
||||
class IntegrityError(DatabaseError): ...
|
||||
|
||||
class InterfaceError(Error): ...
|
||||
|
||||
class InternalError(DatabaseError): ...
|
||||
|
||||
class NotSupportedError(DatabaseError): ...
|
||||
|
||||
class OperationalError(DatabaseError): ...
|
||||
|
||||
if sys.version_info >= (3,):
|
||||
|
||||
Reference in New Issue
Block a user