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

This commit is contained in:
Sebastian Rittau
2021-05-16 16:10:48 +02:00
committed by GitHub
parent dbe77b6ae9
commit 6a9c89e928
49 changed files with 328 additions and 349 deletions

View File

@@ -1,5 +1,5 @@
import sys
from typing import Any, BinaryIO, Generic, Iterable, List, MutableSequence, Text, Tuple, TypeVar, Union, overload
from typing import Any, BinaryIO, Generic, Iterable, List, MutableSequence, Tuple, TypeVar, Union, overload
from typing_extensions import Literal
_IntTypeCode = Literal["b", "B", "h", "H", "i", "I", "l", "L", "q", "Q"]
@@ -7,7 +7,7 @@ _FloatTypeCode = Literal["f", "d"]
_UnicodeTypeCode = Literal["u"]
_TypeCode = Union[_IntTypeCode, _FloatTypeCode, _UnicodeTypeCode]
_T = TypeVar("_T", int, float, Text)
_T = TypeVar("_T", int, float, str)
typecodes: str
@@ -19,7 +19,7 @@ class array(MutableSequence[_T], Generic[_T]):
@overload
def __init__(self: array[float], typecode: _FloatTypeCode, __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
@overload
def __init__(self: array[Text], typecode: _UnicodeTypeCode, __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
def __init__(self: array[str], typecode: _UnicodeTypeCode, __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
@overload
def __init__(self, typecode: str, __initializer: Union[bytes, Iterable[_T]] = ...) -> None: ...
def append(self, __v: _T) -> None: ...