mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 12:44:28 +08:00
Fix typing for plistlib.load{,s} (#3738)
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# Stubs for plistlib
|
||||
|
||||
from typing import (
|
||||
Any, IO, Mapping, MutableMapping, Optional, Union,
|
||||
Any, IO, Mapping, MutableMapping, Optional, overload, Union,
|
||||
Type, TypeVar,
|
||||
)
|
||||
from typing import Dict as DictT
|
||||
@@ -23,8 +23,16 @@ else:
|
||||
_Path = Union[str, unicode]
|
||||
|
||||
if sys.version_info >= (3, 4):
|
||||
@overload
|
||||
def load(fp: IO[bytes], *, fmt: Optional[PlistFormat] = ...,
|
||||
use_builtin_types: bool = ...) -> DictT[str, Any]: ...
|
||||
@overload
|
||||
def load(fp: IO[bytes], *, fmt: Optional[PlistFormat] = ...,
|
||||
use_builtin_types: bool = ..., dict_type: Type[_D] = ...) -> _D: ...
|
||||
@overload
|
||||
def loads(data: bytes, *, fmt: Optional[PlistFormat] = ...,
|
||||
use_builtin_types: bool = ...) -> DictT[str, Any]: ...
|
||||
@overload
|
||||
def loads(data: bytes, *, fmt: Optional[PlistFormat] = ...,
|
||||
use_builtin_types: bool = ..., dict_type: Type[_D] = ...) -> _D: ...
|
||||
def dump(value: Mapping[str, Any], fp: IO[bytes], *,
|
||||
|
||||
Reference in New Issue
Block a user