mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-09 13:34:58 +08:00
Replace 'Text' with 'str' in py3 stdlib (#5466)
This commit is contained in:
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user