Skip to content

Commit 61f364b

Browse files
authored
Parametrize click.types.ParamType as base class in click_web.web_click_types (#15803)
1 parent 5372bd5 commit 61f364b

2 files changed

Lines changed: 6 additions & 6 deletions

File tree

stubs/click-web/click_web/resources/input_fields.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class FieldId:
3131
class NotSupported(ValueError): ...
3232

3333
class BaseInput:
34-
param_type_cls: type[click.types.ParamType] | None
34+
param_type_cls: type[click.types.ParamType[Any]] | None
3535
ctx: click.Context
3636
param: click.Parameter
3737
command_index: int
@@ -73,7 +73,7 @@ class TextAreaInput(BaseInput):
7373
param_type_cls: type[TextAreaParamType]
7474

7575
class DefaultInput(BaseInput):
76-
param_type_cls: type[click.ParamType]
76+
param_type_cls: type[click.ParamType[Any]]
7777

7878
INPUT_TYPES: Final[list[type[BaseInput]]]
7979
_DEFAULT_INPUT: Final[list[type[DefaultInput]]]

stubs/click-web/click_web/web_click_types.pyi

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import re
2-
from typing import ClassVar, TypeVar
2+
from typing import Any, ClassVar, TypeVar
33

44
import click
55

66
_T = TypeVar("_T")
77

8-
class EmailParamType(click.ParamType):
8+
class EmailParamType(click.ParamType[str]):
99
EMAIL_REGEX: ClassVar[re.Pattern[str]]
1010
def convert(self, value: str, param: click.Parameter | None, ctx: click.Context | None) -> str: ...
1111

12-
class PasswordParamType(click.ParamType):
12+
class PasswordParamType(click.ParamType[Any]):
1313
def convert(self, value: _T, param: click.Parameter | None, ctx: click.Context | None) -> _T: ...
1414

15-
class TextAreaParamType(click.ParamType):
15+
class TextAreaParamType(click.ParamType[Any]):
1616
def convert(self, value: _T, param: click.Parameter | None, ctx: click.Context | None) -> _T: ...
1717

1818
EMAIL_TYPE: EmailParamType

0 commit comments

Comments
 (0)