Skip to content

Commit 5367bab

Browse files
authored
Add aware_datetime option to plistlib functions (#11276)
1 parent 0b43c1d commit 5367bab

File tree

1 file changed

+51
-16
lines changed

1 file changed

+51
-16
lines changed

stdlib/plistlib.pyi

Lines changed: 51 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,23 @@ class PlistFormat(Enum):
1616

1717
FMT_XML = PlistFormat.FMT_XML
1818
FMT_BINARY = PlistFormat.FMT_BINARY
19+
if sys.version_info >= (3, 13):
20+
def load(
21+
fp: IO[bytes],
22+
*,
23+
fmt: PlistFormat | None = None,
24+
dict_type: type[MutableMapping[str, Any]] = ...,
25+
aware_datetime: bool = False,
26+
) -> Any: ...
27+
def loads(
28+
value: ReadableBuffer | str,
29+
*,
30+
fmt: PlistFormat | None = None,
31+
dict_type: type[MutableMapping[str, Any]] = ...,
32+
aware_datetime: bool = False,
33+
) -> Any: ...
1934

20-
if sys.version_info >= (3, 9):
35+
elif sys.version_info >= (3, 9):
2136
def load(fp: IO[bytes], *, fmt: PlistFormat | None = None, dict_type: type[MutableMapping[str, Any]] = ...) -> Any: ...
2237
def loads(
2338
value: ReadableBuffer, *, fmt: PlistFormat | None = None, dict_type: type[MutableMapping[str, Any]] = ...
@@ -39,21 +54,41 @@ else:
3954
dict_type: type[MutableMapping[str, Any]] = ...,
4055
) -> Any: ...
4156

42-
def dump(
43-
value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | bytearray | datetime,
44-
fp: IO[bytes],
45-
*,
46-
fmt: PlistFormat = ...,
47-
sort_keys: bool = True,
48-
skipkeys: bool = False,
49-
) -> None: ...
50-
def dumps(
51-
value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | bytearray | datetime,
52-
*,
53-
fmt: PlistFormat = ...,
54-
skipkeys: bool = False,
55-
sort_keys: bool = True,
56-
) -> bytes: ...
57+
if sys.version_info >= (3, 13):
58+
def dump(
59+
value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | bytearray | datetime,
60+
fp: IO[bytes],
61+
*,
62+
fmt: PlistFormat = ...,
63+
sort_keys: bool = True,
64+
skipkeys: bool = False,
65+
aware_datetime: bool = False,
66+
) -> None: ...
67+
def dumps(
68+
value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | bytearray | datetime,
69+
*,
70+
fmt: PlistFormat = ...,
71+
skipkeys: bool = False,
72+
sort_keys: bool = True,
73+
aware_datetime: bool = False,
74+
) -> bytes: ...
75+
76+
else:
77+
def dump(
78+
value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | bytearray | datetime,
79+
fp: IO[bytes],
80+
*,
81+
fmt: PlistFormat = ...,
82+
sort_keys: bool = True,
83+
skipkeys: bool = False,
84+
) -> None: ...
85+
def dumps(
86+
value: Mapping[str, Any] | list[Any] | tuple[Any, ...] | str | bool | float | bytes | bytearray | datetime,
87+
*,
88+
fmt: PlistFormat = ...,
89+
skipkeys: bool = False,
90+
sort_keys: bool = True,
91+
) -> bytes: ...
5792

5893
if sys.version_info < (3, 9):
5994
def readPlist(pathOrFile: str | IO[bytes]) -> Any: ...

0 commit comments

Comments
 (0)