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>
This commit is contained in:
Maciej Olko
2025-01-13 14:35:05 +01:00
committed by GitHub
parent c5f3608372
commit 88be13d059

View File

@@ -1,4 +1,5 @@
from collections.abc import Callable
from pathlib import Path
from typing import IO, Any, Generic, Literal, SupportsIndex, TypeVar, overload
_TB = TypeVar("_TB", bound=_BaseEntry)
@@ -11,9 +12,9 @@ default_encoding: str
# encoding: str
# check_for_duplicates: bool
@overload
def pofile(pofile: str, *, klass: type[_TP], **kwargs: Any) -> _TP: ...
def pofile(pofile: str | Path, *, klass: type[_TP], **kwargs: Any) -> _TP: ...
@overload
def pofile(pofile: str, **kwargs: Any) -> POFile: ...
def pofile(pofile: str | Path, **kwargs: Any) -> POFile: ...
@overload
def mofile(mofile: str, *, klass: type[_TM], **kwargs: Any) -> _TM: ...
@overload