We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
FuncParamType
1 parent 3e2d92c commit 78a4efcCopy full SHA for 78a4efc
1 file changed
src/click/types.py
@@ -182,8 +182,8 @@ class FuncParamTypeInfoDict(ParamTypeInfoDict):
182
func: t.Callable[[t.Any], t.Any]
183
184
185
-class FuncParamType(ParamType[t.Any]):
186
- def __init__(self, func: t.Callable[[t.Any], t.Any]) -> None:
+class FuncParamType(ParamType[ParamTypeValue]):
+ def __init__(self, func: t.Callable[[t.Any], ParamTypeValue]) -> None:
187
self.name: str = func.__name__
188
self.func = func
189
@@ -192,7 +192,7 @@ def to_info_dict(self) -> FuncParamTypeInfoDict:
192
193
def convert(
194
self, value: t.Any, param: Parameter | None, ctx: Context | None
195
- ) -> t.Any:
+ ) -> ParamTypeValue:
196
try:
197
return self.func(value)
198
except ValueError:
0 commit comments