Replace 'Text' with 'str' in py3 stdlib (#5466)

This commit is contained in:
Sebastian Rittau authored and GitHub committed 2021-05-16 07:10:48 -07:00
1 parent dbe77b6ae9
commit 6a9c89e928
49 files changed
+328 -349

No files matched your search

+5 -5
View File
@@ -1,7 +1,7 @@
import os
import sys
from datetime import date, datetime, time
from typing import Any, Callable, Generator, Iterable, Iterator, List, Optional, Protocol, Text, Tuple, Type, TypeVar, Union
from typing import Any, Callable, Generator, Iterable, Iterator, List, Optional, Protocol, Tuple, Type, TypeVar, Union
_T = TypeVar("_T")
@@ -66,7 +66,7 @@ def complete_statement(sql: str) -> bool: ...
if sys.version_info >= (3, 7):
def connect(
database: Union[bytes, Text, os.PathLike[Text]],
database: Union[bytes, str, os.PathLike[str]],
timeout: float = ...,
detect_types: int = ...,
isolation_level: Optional[str] = ...,
@@ -78,7 +78,7 @@ if sys.version_info >= (3, 7):
else:
def connect(
database: Union[bytes, Text],
database: Union[bytes, str],
timeout: float = ...,
detect_types: int = ...,
isolation_level: Optional[str] = ...,
@@ -132,7 +132,7 @@ class Connection(object):
def execute(self, sql: str, parameters: Iterable[Any] = ...) -> Cursor: ...
# TODO: please check in executemany() if seq_of_parameters type is possible like this
def executemany(self, __sql: str, __parameters: Iterable[Iterable[Any]]) -> Cursor: ...
def executescript(self, __sql_script: Union[bytes, Text]) -> Cursor: ...
def executescript(self, __sql_script: Union[bytes, str]) -> Cursor: ...
def interrupt(self, *args: Any, **kwargs: Any) -> None: ...
def iterdump(self, *args: Any, **kwargs: Any) -> Generator[str, None, None]: ...
def rollback(self, *args: Any, **kwargs: Any) -> None: ...
@@ -175,7 +175,7 @@ class Cursor(Iterator[Any]):
def close(self, *args: Any, **kwargs: Any) -> None: ...
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: Union[bytes, Text]) -> Cursor: ...
def executescript(self, __sql_script: Union[bytes, str]) -> Cursor: ...
def fetchall(self) -> List[Any]: ...
def fetchmany(self, size: Optional[int] = ...) -> List[Any]: ...
def fetchone(self) -> Any: ...