diff --git a/third_party/2/six/__init__.pyi b/third_party/2/six/__init__.pyi index f1e4246d2..c4bff59e5 100644 --- a/third_party/2/six/__init__.pyi +++ b/third_party/2/six/__init__.pyi @@ -5,7 +5,7 @@ from __future__ import print_function import types from typing import ( Any, AnyStr, Callable, Dict, Iterable, Mapping, NoReturn, Optional, - Pattern, Tuple, Type, TypeVar, Union, overload, ValuesView, KeysView, ItemsView + Pattern, Text, Tuple, Type, TypeVar, Union, overload, ValuesView, KeysView, ItemsView, ) import typing import unittest @@ -90,4 +90,7 @@ print_ = print def with_metaclass(meta: type, *bases: type) -> type: ... def add_metaclass(metaclass: type) -> Callable[[_T], _T]: ... +def ensure_binary(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> bytes: ... +def ensure_str(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> str: ... +def ensure_text(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> Text: ... def python_2_unicode_compatible(klass: _T) -> _T: ... diff --git a/third_party/3/six/__init__.pyi b/third_party/3/six/__init__.pyi index 4eedd5b40..a500d42e9 100644 --- a/third_party/3/six/__init__.pyi +++ b/third_party/3/six/__init__.pyi @@ -14,6 +14,7 @@ from typing import ( NoReturn, Optional, Pattern, + Text, Tuple, Type, TypeVar, @@ -101,4 +102,7 @@ print_ = print def with_metaclass(meta: type, *bases: type) -> type: ... def add_metaclass(metaclass: type) -> Callable[[_T], _T]: ... +def ensure_binary(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> bytes: ... +def ensure_str(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> str: ... +def ensure_text(s: Union[bytes, Text], encoding: str = ..., errors: str = ...) -> Text: ... def python_2_unicode_compatible(klass: _T) -> _T: ...