Akuli and srittau: Remove Python 2 branches from Python 3 stubs (#5461)

* run script and do some manual changes (Akuli)

* do the whole thing manually (srittau)

* merge changes (Akuli)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
This commit is contained in:
Akuli
2021-05-15 15:33:39 +03:00
committed by GitHub
parent b0ef85288d
commit 17dcea4a68
106 changed files with 1539 additions and 3275 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 = memoryview
# The remaining definitions are imported from _sqlite3.
@@ -79,18 +76,6 @@ if sys.version_info >= (3, 7):
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],
@@ -100,6 +85,7 @@ else:
check_same_thread: bool = ...,
factory: Optional[Type[Connection]] = ...,
cached_statements: int = ...,
uri: bool = ...,
) -> Connection: ...
def enable_callback_tracebacks(__enable: bool) -> None: ...
@@ -196,10 +182,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 +193,7 @@ 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): ...
OptimizedUnicode = str
class PrepareProtocol(object):
def __init__(self, *args: Any, **kwargs: Any) -> None: ...