From ba223399a6eb91e882a3d4b6acd884941667a43e Mon Sep 17 00:00:00 2001 From: Lourens Veen Date: Fri, 20 Nov 2020 22:14:13 +0100 Subject: [PATCH] collections.UserString.encode() returns bytes (#4781) --- stdlib/2/UserString.pyi | 2 +- stdlib/3/collections/__init__.pyi | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/2/UserString.pyi b/stdlib/2/UserString.pyi index df7bbc363b9f..8e5086cc4f60 100644 --- a/stdlib/2/UserString.pyi +++ b/stdlib/2/UserString.pyi @@ -26,7 +26,7 @@ class UserString(Sequence[UserString]): def center(self: _UST, width: int, *args: Any) -> _UST: ... def count(self, sub: int, start: int = ..., end: int = ...) -> int: ... def decode(self: _UST, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UST: ... - def encode(self: _UST, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UST: ... + def encode(self: _UST, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> str: ... def endswith(self, suffix: Text, start: int = ..., end: int = ...) -> bool: ... def expandtabs(self: _UST, tabsize: int = ...) -> _UST: ... def find(self, sub: Text, start: int = ..., end: int = ...) -> int: ... diff --git a/stdlib/3/collections/__init__.pyi b/stdlib/3/collections/__init__.pyi index 39bed2d99b9c..52470a3bf567 100644 --- a/stdlib/3/collections/__init__.pyi +++ b/stdlib/3/collections/__init__.pyi @@ -137,7 +137,7 @@ class UserString(Sequence[str]): def casefold(self: _UserStringT) -> _UserStringT: ... def center(self: _UserStringT, width: int, *args: Any) -> _UserStringT: ... def count(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ... - def encode(self: _UserStringT, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> _UserStringT: ... + def encode(self: _UserStringT, encoding: Optional[str] = ..., errors: Optional[str] = ...) -> bytes: ... def endswith(self, suffix: Union[str, Tuple[str, ...]], start: int = ..., end: int = ...) -> bool: ... def expandtabs(self: _UserStringT, tabsize: int = ...) -> _UserStringT: ... def find(self, sub: Union[str, UserString], start: int = ..., end: int = ...) -> int: ...