mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user