Skip to content

Commit 88be13d

Browse files
Allow Path in polib.pofile() (#13396)
* Allow PathLike in polib.pofile() * Add missing import * [pre-commit.ci] auto fixes from pre-commit.com hooks * Update type to pathlib.Path --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent c5f3608 commit 88be13d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

stubs/polib/polib.pyi

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
from collections.abc import Callable
2+
from pathlib import Path
23
from typing import IO, Any, Generic, Literal, SupportsIndex, TypeVar, overload
34

45
_TB = TypeVar("_TB", bound=_BaseEntry)
@@ -11,9 +12,9 @@ default_encoding: str
1112
# encoding: str
1213
# check_for_duplicates: bool
1314
@overload
14-
def pofile(pofile: str, *, klass: type[_TP], **kwargs: Any) -> _TP: ...
15+
def pofile(pofile: str | Path, *, klass: type[_TP], **kwargs: Any) -> _TP: ...
1516
@overload
16-
def pofile(pofile: str, **kwargs: Any) -> POFile: ...
17+
def pofile(pofile: str | Path, **kwargs: Any) -> POFile: ...
1718
@overload
1819
def mofile(mofile: str, *, klass: type[_TM], **kwargs: Any) -> _TM: ...
1920
@overload

0 commit comments

Comments
 (0)