From 88be13d05958ac87ec26e786325a56752a49d84a Mon Sep 17 00:00:00 2001 From: Maciej Olko Date: Mon, 13 Jan 2025 14:35:05 +0100 Subject: [PATCH] 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> --- stubs/polib/polib.pyi | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/stubs/polib/polib.pyi b/stubs/polib/polib.pyi index 0788fe8ca..fa7061f1f 100644 --- a/stubs/polib/polib.pyi +++ b/stubs/polib/polib.pyi @@ -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