clean python 3 specific stuff from stdlib/@python2 stubs (#5451)

This commit is contained in:
Akuli
2021-05-15 01:19:05 +03:00
committed by GitHub
parent f94d838814
commit 5ec4f06263
121 changed files with 1024 additions and 4801 deletions

View File

@@ -18,10 +18,7 @@ def TimestampFromTicks(ticks: float) -> Timestamp: ...
version_info: Tuple[int, int, int]
sqlite_version_info: Tuple[int, int, int]
if sys.version_info >= (3,):
Binary = memoryview
else:
Binary = buffer
Binary = buffer
# The remaining definitions are imported from _sqlite3.
@@ -66,52 +63,24 @@ 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: ...
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: ...
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(__enable: bool) -> None: ...
def enable_shared_cache(enable: int) -> None: ...
def register_adapter(__type: Type[_T], __caster: Callable[[_T], Union[int, float, str, bytes]]) -> None: ...
def register_converter(__name: str, __converter: Callable[[bytes], Any]) -> None: ...
if sys.version_info < (3, 8):
class Cache(object):
def __init__(self, *args, **kwargs) -> None: ...
def display(self, *args, **kwargs) -> None: ...
def get(self, *args, **kwargs) -> None: ...
class Cache(object):
def __init__(self, *args, **kwargs) -> None: ...
def display(self, *args, **kwargs) -> None: ...
def get(self, *args, **kwargs) -> None: ...
class _AggregateProtocol(Protocol):
def step(self, value: int) -> None: ...
@@ -138,10 +107,7 @@ class Connection(object):
def commit(self) -> None: ...
def create_aggregate(self, name: str, n_arg: int, aggregate_class: Callable[[], _AggregateProtocol]) -> None: ...
def create_collation(self, __name: str, __callback: Any) -> None: ...
if sys.version_info >= (3, 8):
def create_function(self, name: str, narg: int, func: Any, *, deterministic: bool = ...) -> None: ...
else:
def create_function(self, name: str, num_params: int, func: Any) -> None: ...
def create_function(self, name: str, num_params: int, func: Any) -> None: ...
def cursor(self, cursorClass: Optional[type] = ...) -> Cursor: ...
def execute(self, sql: str, parameters: Iterable[Any] = ...) -> Cursor: ...
# TODO: please check in executemany() if seq_of_parameters type is possible like this
@@ -161,16 +127,6 @@ class Connection(object):
# without sqlite3 loadable extension support. see footnotes https://docs.python.org/3/library/sqlite3.html#f1
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 __call__(self, *args: Any, **kwargs: Any) -> Any: ...
def __enter__(self) -> Connection: ...
def __exit__(self, t: Optional[type], exc: Optional[BaseException], tb: Optional[Any]) -> None: ...
@@ -196,10 +152,7 @@ class Cursor(Iterator[Any]):
def setinputsizes(self, *args: Any, **kwargs: Any) -> None: ...
def setoutputsize(self, *args: Any, **kwargs: Any) -> None: ...
def __iter__(self) -> Cursor: ...
if sys.version_info >= (3, 0):
def __next__(self) -> Any: ...
else:
def next(self) -> Any: ...
def next(self) -> Any: ...
class DataError(DatabaseError): ...
class DatabaseError(Error): ...
@@ -210,73 +163,70 @@ class InternalError(DatabaseError): ...
class NotSupportedError(DatabaseError): ...
class OperationalError(DatabaseError): ...
if sys.version_info >= (3,):
OptimizedUnicode = str
else:
class OptimizedUnicode(object):
maketrans: Any
def __init__(self, *args, **kwargs): ...
def capitalize(self, *args, **kwargs): ...
def casefold(self, *args, **kwargs): ...
def center(self, *args, **kwargs): ...
def count(self, *args, **kwargs): ...
def encode(self, *args, **kwargs): ...
def endswith(self, *args, **kwargs): ...
def expandtabs(self, *args, **kwargs): ...
def find(self, *args, **kwargs): ...
def format(self, *args, **kwargs): ...
def format_map(self, *args, **kwargs): ...
def index(self, *args, **kwargs): ...
def isalnum(self, *args, **kwargs): ...
def isalpha(self, *args, **kwargs): ...
def isdecimal(self, *args, **kwargs): ...
def isdigit(self, *args, **kwargs): ...
def isidentifier(self, *args, **kwargs): ...
def islower(self, *args, **kwargs): ...
def isnumeric(self, *args, **kwargs): ...
def isprintable(self, *args, **kwargs): ...
def isspace(self, *args, **kwargs): ...
def istitle(self, *args, **kwargs): ...
def isupper(self, *args, **kwargs): ...
def join(self, *args, **kwargs): ...
def ljust(self, *args, **kwargs): ...
def lower(self, *args, **kwargs): ...
def lstrip(self, *args, **kwargs): ...
def partition(self, *args, **kwargs): ...
def replace(self, *args, **kwargs): ...
def rfind(self, *args, **kwargs): ...
def rindex(self, *args, **kwargs): ...
def rjust(self, *args, **kwargs): ...
def rpartition(self, *args, **kwargs): ...
def rsplit(self, *args, **kwargs): ...
def rstrip(self, *args, **kwargs): ...
def split(self, *args, **kwargs): ...
def splitlines(self, *args, **kwargs): ...
def startswith(self, *args, **kwargs): ...
def strip(self, *args, **kwargs): ...
def swapcase(self, *args, **kwargs): ...
def title(self, *args, **kwargs): ...
def translate(self, *args, **kwargs): ...
def upper(self, *args, **kwargs): ...
def zfill(self, *args, **kwargs): ...
def __add__(self, other): ...
def __contains__(self, *args, **kwargs): ...
def __eq__(self, other): ...
def __format__(self, *args, **kwargs): ...
def __ge__(self, other): ...
def __getitem__(self, index): ...
def __getnewargs__(self, *args, **kwargs): ...
def __gt__(self, other): ...
def __hash__(self): ...
def __iter__(self): ...
def __le__(self, other): ...
def __len__(self, *args, **kwargs): ...
def __lt__(self, other): ...
def __mod__(self, other): ...
def __mul__(self, other): ...
def __ne__(self, other): ...
def __rmod__(self, other): ...
def __rmul__(self, other): ...
class OptimizedUnicode(object):
maketrans: Any
def __init__(self, *args, **kwargs): ...
def capitalize(self, *args, **kwargs): ...
def casefold(self, *args, **kwargs): ...
def center(self, *args, **kwargs): ...
def count(self, *args, **kwargs): ...
def encode(self, *args, **kwargs): ...
def endswith(self, *args, **kwargs): ...
def expandtabs(self, *args, **kwargs): ...
def find(self, *args, **kwargs): ...
def format(self, *args, **kwargs): ...
def format_map(self, *args, **kwargs): ...
def index(self, *args, **kwargs): ...
def isalnum(self, *args, **kwargs): ...
def isalpha(self, *args, **kwargs): ...
def isdecimal(self, *args, **kwargs): ...
def isdigit(self, *args, **kwargs): ...
def isidentifier(self, *args, **kwargs): ...
def islower(self, *args, **kwargs): ...
def isnumeric(self, *args, **kwargs): ...
def isprintable(self, *args, **kwargs): ...
def isspace(self, *args, **kwargs): ...
def istitle(self, *args, **kwargs): ...
def isupper(self, *args, **kwargs): ...
def join(self, *args, **kwargs): ...
def ljust(self, *args, **kwargs): ...
def lower(self, *args, **kwargs): ...
def lstrip(self, *args, **kwargs): ...
def partition(self, *args, **kwargs): ...
def replace(self, *args, **kwargs): ...
def rfind(self, *args, **kwargs): ...
def rindex(self, *args, **kwargs): ...
def rjust(self, *args, **kwargs): ...
def rpartition(self, *args, **kwargs): ...
def rsplit(self, *args, **kwargs): ...
def rstrip(self, *args, **kwargs): ...
def split(self, *args, **kwargs): ...
def splitlines(self, *args, **kwargs): ...
def startswith(self, *args, **kwargs): ...
def strip(self, *args, **kwargs): ...
def swapcase(self, *args, **kwargs): ...
def title(self, *args, **kwargs): ...
def translate(self, *args, **kwargs): ...
def upper(self, *args, **kwargs): ...
def zfill(self, *args, **kwargs): ...
def __add__(self, other): ...
def __contains__(self, *args, **kwargs): ...
def __eq__(self, other): ...
def __format__(self, *args, **kwargs): ...
def __ge__(self, other): ...
def __getitem__(self, index): ...
def __getnewargs__(self, *args, **kwargs): ...
def __gt__(self, other): ...
def __hash__(self): ...
def __iter__(self): ...
def __le__(self, other): ...
def __len__(self, *args, **kwargs): ...
def __lt__(self, other): ...
def __mod__(self, other): ...
def __mul__(self, other): ...
def __ne__(self, other): ...
def __rmod__(self, other): ...
def __rmul__(self, other): ...
class PrepareProtocol(object):
def __init__(self, *args: Any, **kwargs: Any) -> None: ...
@@ -297,8 +247,7 @@ class Row(object):
def __lt__(self, other): ...
def __ne__(self, other): ...
if sys.version_info < (3, 8):
class Statement(object):
def __init__(self, *args, **kwargs): ...
class Statement(object):
def __init__(self, *args, **kwargs): ...
class Warning(Exception): ...