mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
Add stubs for six.ensure_{binary,str,text} functions (#2704)
This commit is contained in:
committed by
Jelle Zijlstra
parent
44e6b6e0d4
commit
a2c0f4b827
5
third_party/2/six/__init__.pyi
vendored
5
third_party/2/six/__init__.pyi
vendored
@@ -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: ...
|
||||
|
||||
4
third_party/3/six/__init__.pyi
vendored
4
third_party/3/six/__init__.pyi
vendored
@@ -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: ...
|
||||
|
||||
Reference in New Issue
Block a user