Skip to content

Commit

Permalink
Fix type hint for msgctxt parameter in polib (python#12506)
Browse files Browse the repository at this point in the history
  • Loading branch information
ZeroIntensity authored and max-muoto committed Sep 8, 2024
1 parent 7ec3efe commit b31b53c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions stubs/polib/polib.pyi
Original file line number Diff line number Diff line change
@@ -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)
Expand Down Expand Up @@ -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: ...

Expand Down

0 comments on commit b31b53c

Please sign in to comment.