1
+ from _typeshed import IdentityFunction
1
2
from distutils .version import Version
2
- from typing import Any , Callable , Dict , Iterable , List , Optional , Protocol , Text , Tuple , Type , TypeVar , Union , overload
3
+ from typing import Any , Callable , Dict , Iterable , List , Optional , Text , Tuple , Type , TypeVar , Union , overload
3
4
4
5
from click .core import Argument , Command , Context , Group , Option , Parameter , _ConvertibleType
5
6
6
7
_T = TypeVar ("_T" )
7
8
_F = TypeVar ("_F" , bound = Callable [..., Any ])
8
9
9
- class _IdentityFunction (Protocol ):
10
- def __call__ (self , __x : _T ) -> _T : ...
11
-
12
10
_Callback = Callable [[Context , Union [Option , Parameter ], Any ], Any ]
13
11
14
12
def pass_context (__f : _T ) -> _T : ...
15
13
def pass_obj (__f : _T ) -> _T : ...
16
- def make_pass_decorator (object_type : type , ensure : bool = ...) -> _IdentityFunction : ...
14
+ def make_pass_decorator (object_type : type , ensure : bool = ...) -> IdentityFunction : ...
17
15
18
16
# NOTE: Decorators below have **attrs converted to concrete constructor
19
17
# arguments from core.pyi to help with type checking.
@@ -72,7 +70,7 @@ def argument(
72
70
is_eager : bool = ...,
73
71
envvar : Optional [Union [str , List [str ]]] = ...,
74
72
autocompletion : Optional [Callable [[Context , List [str ], str ], Iterable [Union [str , Tuple [str , str ]]]]] = ...,
75
- ) -> _IdentityFunction : ...
73
+ ) -> IdentityFunction : ...
76
74
@overload
77
75
def option (
78
76
* param_decls : Text ,
@@ -101,7 +99,7 @@ def option(
101
99
envvar : Optional [Union [str , List [str ]]] = ...,
102
100
# User-defined
103
101
** kwargs : Any ,
104
- ) -> _IdentityFunction : ...
102
+ ) -> IdentityFunction : ...
105
103
@overload
106
104
def option (
107
105
* param_decls : str ,
@@ -130,7 +128,7 @@ def option(
130
128
envvar : Optional [Union [str , List [str ]]] = ...,
131
129
# User-defined
132
130
** kwargs : Any ,
133
- ) -> _IdentityFunction : ...
131
+ ) -> IdentityFunction : ...
134
132
@overload
135
133
def option (
136
134
* param_decls : str ,
@@ -159,7 +157,7 @@ def option(
159
157
envvar : Optional [Union [str , List [str ]]] = ...,
160
158
# User-defined
161
159
** kwargs : Any ,
162
- ) -> _IdentityFunction : ...
160
+ ) -> IdentityFunction : ...
163
161
@overload
164
162
def option (
165
163
* param_decls : str ,
@@ -188,7 +186,7 @@ def option(
188
186
envvar : Optional [Union [str , List [str ]]] = ...,
189
187
# User-defined
190
188
** kwargs : Any ,
191
- ) -> _IdentityFunction : ...
189
+ ) -> IdentityFunction : ...
192
190
def confirmation_option (
193
191
* param_decls : str ,
194
192
cls : Type [Option ] = ...,
@@ -213,7 +211,7 @@ def confirmation_option(
213
211
expose_value : bool = ...,
214
212
is_eager : bool = ...,
215
213
envvar : Optional [Union [str , List [str ]]] = ...,
216
- ) -> _IdentityFunction : ...
214
+ ) -> IdentityFunction : ...
217
215
def password_option (
218
216
* param_decls : str ,
219
217
cls : Type [Option ] = ...,
@@ -238,7 +236,7 @@ def password_option(
238
236
expose_value : bool = ...,
239
237
is_eager : bool = ...,
240
238
envvar : Optional [Union [str , List [str ]]] = ...,
241
- ) -> _IdentityFunction : ...
239
+ ) -> IdentityFunction : ...
242
240
def version_option (
243
241
version : Optional [Union [str , Version ]] = ...,
244
242
* param_decls : str ,
@@ -266,7 +264,7 @@ def version_option(
266
264
expose_value : bool = ...,
267
265
is_eager : bool = ...,
268
266
envvar : Optional [Union [str , List [str ]]] = ...,
269
- ) -> _IdentityFunction : ...
267
+ ) -> IdentityFunction : ...
270
268
def help_option (
271
269
* param_decls : str ,
272
270
cls : Type [Option ] = ...,
@@ -291,4 +289,4 @@ def help_option(
291
289
expose_value : bool = ...,
292
290
is_eager : bool = ...,
293
291
envvar : Optional [Union [str , List [str ]]] = ...,
294
- ) -> _IdentityFunction : ...
292
+ ) -> IdentityFunction : ...
0 commit comments