Expand several stdlib methods to accept unicode or str. (#869)

Expand several stdlib methods to accept unicode or str.
This commit is contained in:
Lucas Wiman
2017-01-27 08:03:25 -08:00
committed by Jukka Lehtosalo
parent c8435f4315
commit 6d1edb285d
3 changed files with 6 additions and 6 deletions

View File

@@ -18,7 +18,7 @@ _KT = TypeVar('_KT')
_VT = TypeVar('_VT')
# namedtuple is special-cased in the type checker; the initializer is ignored.
def namedtuple(typename: str, field_names: Union[str, Iterable[Any]], *,
def namedtuple(typename: Union[str, unicode], field_names: Union[str, unicode, Iterable[Any]], *,
verbose: bool = ..., rename: bool = ...) -> Type[tuple]: ...
class deque(Sized, Iterable[_T], Reversible[_T], Generic[_T]):

View File

@@ -38,7 +38,7 @@ class date(object):
def day(self) -> int: ...
def ctime(self) -> str: ...
def strftime(self, fmt: str) -> str: ...
def strftime(self, fmt: Union[str, unicode]) -> str: ...
def __format__(self, fmt: Union[str, unicode]) -> str: ...
def isoformat(self) -> str: ...
def timetuple(self) -> struct_time: ...
@@ -83,7 +83,7 @@ class time:
def __gt__(self, other: time) -> bool: ...
def __hash__(self) -> int: ...
def isoformat(self) -> str: ...
def strftime(self, fmt: str) -> str: ...
def strftime(self, fmt: Union[str, unicode]) -> str: ...
def __format__(self, fmt: str) -> str: ...
def utcoffset(self) -> Optional[timedelta]: ...
def tzname(self) -> Optional[str]: ...
@@ -177,7 +177,7 @@ class datetime(object):
def utcnow(cls) -> datetime: ...
@classmethod
def combine(cls, date: date, time: time) -> datetime: ...
def strftime(self, fmt: str) -> str: ...
def strftime(self, fmt: Union[str, unicode]) -> str: ...
def __format__(self, fmt: str) -> str: ...
def toordinal(self) -> int: ...
def timetuple(self) -> struct_time: ...
@@ -193,7 +193,7 @@ class datetime(object):
def ctime(self) -> str: ...
def isoformat(self, sep: str = ...) -> str: ...
@classmethod
def strptime(cls, date_string: str, format: str) -> datetime: ...
def strptime(cls, date_string: Union[str, unicode], format: Union[str, unicode]) -> datetime: ...
def utcoffset(self) -> Optional[timedelta]: ...
def tzname(self) -> Optional[str]: ...
def dst(self) -> Optional[int]: ...

View File

@@ -54,7 +54,7 @@ def getcontext() -> Context: ...
def localcontext(ctx: Optional[Context] = None) -> _ContextManager: ...
class Decimal(SupportsAbs[Decimal], SupportsFloat, SupportsInt):
def __init__(cls, value: Union[_Decimal, float, str,
def __init__(cls, value: Union[_Decimal, float, str, unicode,
Tuple[int, Sequence[int], int]] = ...,
context: Context = ...) -> None: ...
@classmethod