Skip to content

Commit 39693fe

Browse files
committed
plistlib: improve bytes handling
1 parent 3d8d744 commit 39693fe

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

stdlib/plistlib.pyi

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import sys
2-
from _typeshed import Self
2+
from _typeshed import Self, ReadableBuffer
33
from collections.abc import Mapping, MutableMapping
44
from datetime import datetime
55
from enum import Enum
@@ -48,7 +48,7 @@ FMT_BINARY = PlistFormat.FMT_BINARY
4848

4949
if sys.version_info >= (3, 9):
5050
def load(fp: IO[bytes], *, fmt: PlistFormat | None = ..., dict_type: type[MutableMapping[str, Any]] = ...) -> Any: ...
51-
def loads(value: bytes, *, fmt: PlistFormat | None = ..., dict_type: type[MutableMapping[str, Any]] = ...) -> Any: ...
51+
def loads(value: ReadableBuffer, *, fmt: PlistFormat | None = ..., dict_type: type[MutableMapping[str, Any]] = ...) -> Any: ...
5252

5353
else:
5454
def load(
@@ -59,23 +59,23 @@ else:
5959
dict_type: type[MutableMapping[str, Any]] = ...,
6060
) -> Any: ...
6161
def loads(
62-
value: bytes,
62+
value: ReadableBuffer,
6363
*,
6464
fmt: PlistFormat | None = ...,
6565
use_builtin_types: bool = ...,
6666
dict_type: type[MutableMapping[str, Any]] = ...,
6767
) -> Any: ...
6868

6969
def dump(
70-
value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | datetime,
70+
value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | bytearray | datetime,
7171
fp: IO[bytes],
7272
*,
7373
fmt: PlistFormat = ...,
7474
sort_keys: bool = ...,
7575
skipkeys: bool = ...,
7676
) -> None: ...
7777
def dumps(
78-
value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | datetime,
78+
value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | bytearray | datetime,
7979
*,
8080
fmt: PlistFormat = ...,
8181
skipkeys: bool = ...,
@@ -85,7 +85,7 @@ def dumps(
8585
if sys.version_info < (3, 9):
8686
def readPlist(pathOrFile: str | IO[bytes]) -> Any: ...
8787
def writePlist(value: Mapping[str, Any], pathOrFile: str | IO[bytes]) -> None: ...
88-
def readPlistFromBytes(data: bytes) -> Any: ...
88+
def readPlistFromBytes(data: ReadableBuffer) -> Any: ...
8989
def writePlistToBytes(value: Mapping[str, Any]) -> bytes: ...
9090

9191
if sys.version_info < (3, 9):

0 commit comments

Comments
 (0)