mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-06 12:14:27 +08:00
Allow Python 2 unicode for some click interfaces (#4825)
Helps Python 2 code using:
form __future__ import unicode_literals
On Python 2, these interfaces are compatible with both str and unicode.
This commit is contained in:
6
third_party/2and3/click/decorators.pyi
vendored
6
third_party/2and3/click/decorators.pyi
vendored
@@ -57,7 +57,7 @@ def group(
|
||||
**kwargs: Any,
|
||||
) -> Callable[[Callable[..., Any]], Group]: ...
|
||||
def argument(
|
||||
*param_decls: str,
|
||||
*param_decls: Text,
|
||||
cls: Type[Argument] = ...,
|
||||
# Argument
|
||||
required: Optional[bool] = ...,
|
||||
@@ -74,7 +74,7 @@ def argument(
|
||||
) -> _IdentityFunction: ...
|
||||
@overload
|
||||
def option(
|
||||
*param_decls: str,
|
||||
*param_decls: Text,
|
||||
cls: Type[Option] = ...,
|
||||
# Option
|
||||
show_default: Union[bool, Text] = ...,
|
||||
@@ -87,7 +87,7 @@ def option(
|
||||
count: bool = ...,
|
||||
allow_from_autoenv: bool = ...,
|
||||
type: Optional[_ConvertibleType] = ...,
|
||||
help: Optional[str] = ...,
|
||||
help: Optional[Text] = ...,
|
||||
show_choices: bool = ...,
|
||||
# Parameter
|
||||
default: Optional[Any] = ...,
|
||||
|
||||
4
third_party/2and3/click/termui.pyi
vendored
4
third_party/2and3/click/termui.pyi
vendored
@@ -63,8 +63,8 @@ def progressbar(
|
||||
def clear() -> None: ...
|
||||
def style(
|
||||
text: Text,
|
||||
fg: Optional[str] = ...,
|
||||
bg: Optional[str] = ...,
|
||||
fg: Optional[Text] = ...,
|
||||
bg: Optional[Text] = ...,
|
||||
bold: Optional[bool] = ...,
|
||||
dim: Optional[bool] = ...,
|
||||
underline: Optional[bool] = ...,
|
||||
|
||||
4
third_party/2and3/click/types.pyi
vendored
4
third_party/2and3/click/types.pyi
vendored
@@ -1,6 +1,6 @@
|
||||
import datetime
|
||||
import uuid
|
||||
from typing import IO, Any, Callable, Generic, Iterable, List, Optional, Tuple as _PyTuple, Type, TypeVar, Union
|
||||
from typing import IO, Any, Callable, Generic, Iterable, List, Optional, Text, Tuple as _PyTuple, Type, TypeVar, Union
|
||||
|
||||
from click.core import Context, Parameter, _ConvertibleType, _ParamType
|
||||
|
||||
@@ -31,7 +31,7 @@ class FloatRange(FloatParamType):
|
||||
class File(ParamType):
|
||||
def __init__(
|
||||
self,
|
||||
mode: str = ...,
|
||||
mode: Text = ...,
|
||||
encoding: Optional[str] = ...,
|
||||
errors: Optional[str] = ...,
|
||||
lazy: Optional[bool] = ...,
|
||||
|
||||
Reference in New Issue
Block a user