mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-24 12:51:27 +08:00
Use more precise type for gettext.find (#6980)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
@@ -27,6 +27,15 @@ class GNUTranslations(NullTranslations):
|
||||
CONTEXT: str
|
||||
VERSIONS: Sequence[int]
|
||||
|
||||
@overload # ignores incompatible overloads
|
||||
def find( # type: ignore[misc]
|
||||
domain: str, localedir: StrPath | None = ..., languages: Iterable[str] | None = ..., all: Literal[False] = ...
|
||||
) -> str | None: ...
|
||||
@overload
|
||||
def find(
|
||||
domain: str, localedir: StrPath | None = ..., languages: Iterable[str] | None = ..., all: Literal[True] = ...
|
||||
) -> list[str]: ...
|
||||
@overload
|
||||
def find(domain: str, localedir: StrPath | None = ..., languages: Iterable[str] | None = ..., all: bool = ...) -> Any: ...
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
Reference in New Issue
Block a user