Skip to content

Commit 78a4efc

Browse files
committed
Make FuncParamType is generic
Refs: #3371 (comment)
1 parent 3e2d92c commit 78a4efc

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/click/types.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,8 @@ class FuncParamTypeInfoDict(ParamTypeInfoDict):
182182
func: t.Callable[[t.Any], t.Any]
183183

184184

185-
class FuncParamType(ParamType[t.Any]):
186-
def __init__(self, func: t.Callable[[t.Any], t.Any]) -> None:
185+
class FuncParamType(ParamType[ParamTypeValue]):
186+
def __init__(self, func: t.Callable[[t.Any], ParamTypeValue]) -> None:
187187
self.name: str = func.__name__
188188
self.func = func
189189

@@ -192,7 +192,7 @@ def to_info_dict(self) -> FuncParamTypeInfoDict:
192192

193193
def convert(
194194
self, value: t.Any, param: Parameter | None, ctx: Context | None
195-
) -> t.Any:
195+
) -> ParamTypeValue:
196196
try:
197197
return self.func(value)
198198
except ValueError:

0 commit comments

Comments
 (0)