Import names from typing directly rather than importing module (#13761)

This commit is contained in:
Avasam
2025-04-12 19:10:09 +02:00
committed by GitHub
parent 7ffb7e0832
commit a045be8ed6
10 changed files with 43 additions and 34 deletions
@@ -1,17 +1,19 @@
import re
from typing import ClassVar
from typing import ClassVar, TypeVar
import click
_T = TypeVar("_T")
class EmailParamType(click.ParamType):
EMAIL_REGEX: ClassVar[re.Pattern[str]]
def convert(self, value: str, param: click.Parameter | None, ctx: click.Context | None) -> str | None: ...
def convert(self, value: str, param: click.Parameter | None, ctx: click.Context | None) -> str: ...
class PasswordParamType(click.ParamType):
def convert(self, value: str, param: click.Parameter | None, ctx: click.Context | None) -> str | None: ...
def convert(self, value: _T, param: click.Parameter | None, ctx: click.Context | None) -> _T: ...
class TextAreaParamType(click.ParamType):
def convert(self, value: str, param: click.Parameter | None, ctx: click.Context | None) -> str | None: ...
def convert(self, value: _T, param: click.Parameter | None, ctx: click.Context | None) -> _T: ...
EMAIL_TYPE: EmailParamType
PASSWORD_TYPE: PasswordParamType