|
| 1 | +import sys |
1 | 2 | from _typeshed import SupportsWrite |
2 | 3 | from collections import deque |
3 | 4 | from typing import IO |
4 | 5 |
|
5 | 6 | __all__ = ["pprint", "pformat", "isreadable", "isrecursive", "saferepr", "PrettyPrinter", "pp"] |
6 | 7 |
|
7 | | -def pformat( |
8 | | - object: object, |
9 | | - indent: int = 1, |
10 | | - width: int = 80, |
11 | | - depth: int | None = None, |
12 | | - *, |
13 | | - compact: bool = False, |
14 | | - sort_dicts: bool = True, |
15 | | - underscore_numbers: bool = False, |
16 | | -) -> str: ... |
17 | | -def pp( |
18 | | - object: object, |
19 | | - stream: IO[str] | None = None, |
20 | | - indent: int = 1, |
21 | | - width: int = 80, |
22 | | - depth: int | None = None, |
23 | | - *, |
24 | | - compact: bool = False, |
25 | | - sort_dicts: bool = False, |
26 | | - underscore_numbers: bool = False, |
27 | | -) -> None: ... |
28 | | -def pprint( |
29 | | - object: object, |
30 | | - stream: IO[str] | None = None, |
31 | | - indent: int = 1, |
32 | | - width: int = 80, |
33 | | - depth: int | None = None, |
34 | | - *, |
35 | | - compact: bool = False, |
36 | | - sort_dicts: bool = True, |
37 | | - underscore_numbers: bool = False, |
38 | | -) -> None: ... |
39 | | -def isreadable(object: object) -> bool: ... |
40 | | -def isrecursive(object: object) -> bool: ... |
41 | | -def saferepr(object: object) -> str: ... |
| 8 | +if sys.version_info >= (3, 15): |
| 9 | + def pformat( |
| 10 | + object: object, |
| 11 | + indent: int = 4, |
| 12 | + width: int = 88, |
| 13 | + depth: int | None = None, |
| 14 | + *, |
| 15 | + compact: bool = False, |
| 16 | + sort_dicts: bool = True, |
| 17 | + underscore_numbers: bool = False, |
| 18 | + ) -> str: ... |
42 | 19 |
|
43 | | -class PrettyPrinter: |
44 | | - def __init__( |
45 | | - self, |
| 20 | +else: |
| 21 | + def pformat( |
| 22 | + object: object, |
46 | 23 | indent: int = 1, |
47 | 24 | width: int = 80, |
48 | 25 | depth: int | None = None, |
| 26 | + *, |
| 27 | + compact: bool = False, |
| 28 | + sort_dicts: bool = True, |
| 29 | + underscore_numbers: bool = False, |
| 30 | + ) -> str: ... |
| 31 | + |
| 32 | +if sys.version_info >= (3, 15): |
| 33 | + def pp( |
| 34 | + object: object, |
| 35 | + stream: IO[str] | None = None, |
| 36 | + indent: int = 4, |
| 37 | + width: int = 88, |
| 38 | + depth: int | None = None, |
| 39 | + *, |
| 40 | + compact: bool = False, |
| 41 | + sort_dicts: bool = False, |
| 42 | + underscore_numbers: bool = False, |
| 43 | + ) -> None: ... |
| 44 | + |
| 45 | +else: |
| 46 | + def pp( |
| 47 | + object: object, |
49 | 48 | stream: IO[str] | None = None, |
| 49 | + indent: int = 1, |
| 50 | + width: int = 80, |
| 51 | + depth: int | None = None, |
| 52 | + *, |
| 53 | + compact: bool = False, |
| 54 | + sort_dicts: bool = False, |
| 55 | + underscore_numbers: bool = False, |
| 56 | + ) -> None: ... |
| 57 | + |
| 58 | +if sys.version_info >= (3, 15): |
| 59 | + def pprint( |
| 60 | + object: object, |
| 61 | + stream: IO[str] | None = None, |
| 62 | + indent: int = 4, |
| 63 | + width: int = 88, |
| 64 | + depth: int | None = None, |
| 65 | + *, |
| 66 | + compact: bool = False, |
| 67 | + sort_dicts: bool = True, |
| 68 | + underscore_numbers: bool = False, |
| 69 | + ) -> None: ... |
| 70 | + |
| 71 | +else: |
| 72 | + def pprint( |
| 73 | + object: object, |
| 74 | + stream: IO[str] | None = None, |
| 75 | + indent: int = 1, |
| 76 | + width: int = 80, |
| 77 | + depth: int | None = None, |
50 | 78 | *, |
51 | 79 | compact: bool = False, |
52 | 80 | sort_dicts: bool = True, |
53 | 81 | underscore_numbers: bool = False, |
54 | 82 | ) -> None: ... |
| 83 | + |
| 84 | +def isreadable(object: object) -> bool: ... |
| 85 | +def isrecursive(object: object) -> bool: ... |
| 86 | +def saferepr(object: object) -> str: ... |
| 87 | + |
| 88 | +class PrettyPrinter: |
| 89 | + if sys.version_info >= (3, 15): |
| 90 | + def __init__( |
| 91 | + self, |
| 92 | + indent: int = 4, |
| 93 | + width: int = 88, |
| 94 | + depth: int | None = None, |
| 95 | + stream: IO[str] | None = None, |
| 96 | + *, |
| 97 | + compact: bool = False, |
| 98 | + sort_dicts: bool = True, |
| 99 | + underscore_numbers: bool = False, |
| 100 | + ) -> None: ... |
| 101 | + else: |
| 102 | + def __init__( |
| 103 | + self, |
| 104 | + indent: int = 1, |
| 105 | + width: int = 80, |
| 106 | + depth: int | None = None, |
| 107 | + stream: IO[str] | None = None, |
| 108 | + *, |
| 109 | + compact: bool = False, |
| 110 | + sort_dicts: bool = True, |
| 111 | + underscore_numbers: bool = False, |
| 112 | + ) -> None: ... |
| 113 | + |
55 | 114 | def pformat(self, object: object) -> str: ... |
56 | 115 | def pprint(self, object: object) -> None: ... |
57 | 116 | def isreadable(self, object: object) -> bool: ... |
|
0 commit comments