Fix type hint for msgctxt parameter in polib (#12506)

This commit is contained in:
Peter Bierma
2024-08-10 07:33:50 +00:00
committed by GitHub
parent 67db06b3a1
commit 119b204ed1

View File

@@ -1,5 +1,5 @@
from collections.abc import Callable
from typing import IO, Any, Generic, SupportsIndex, TypeVar, overload
from typing import IO, Any, Generic, Literal, SupportsIndex, TypeVar, overload
_TB = TypeVar("_TB", bound=_BaseEntry)
_TP = TypeVar("_TP", bound=POFile)
@@ -38,7 +38,9 @@ class _BaseFile(list[_TB]):
def insert(self, index: SupportsIndex, entry: _TB) -> None: ...
def metadata_as_entry(self) -> POEntry: ...
def save(self, fpath: str | None = ..., repr_method: str = ..., newline: str | None = ...) -> None: ...
def find(self, st: str, by: str = ..., include_obsolete_entries: bool = ..., msgctxt: bool = ...) -> _TB | None: ...
def find(
self, st: str, by: str = ..., include_obsolete_entries: bool = ..., msgctxt: str | Literal[False] = ...
) -> _TB | None: ...
def ordered_metadata(self) -> list[tuple[str, str]]: ...
def to_binary(self) -> bytes: ...