Skip to content

Commit b6e21d0

Browse files
Add some defaults and __slots__ for 3.14 (#14622)
1 parent 94b1880 commit b6e21d0

File tree

7 files changed

+26
-4
lines changed

7 files changed

+26
-4
lines changed

stdlib/annotationlib.pyi

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,20 @@ if sys.version_info >= (3, 14):
2828

2929
@final
3030
class ForwardRef:
31+
__slots__ = (
32+
"__forward_is_argument__",
33+
"__forward_is_class__",
34+
"__forward_module__",
35+
"__weakref__",
36+
"__arg__",
37+
"__globals__",
38+
"__extra_names__",
39+
"__code__",
40+
"__ast_node__",
41+
"__cell__",
42+
"__owner__",
43+
"__stringifier_dict__",
44+
)
3145
__forward_is_argument__: bool
3246
__forward_is_class__: bool
3347
__forward_module__: str | None

stdlib/argparse.pyi

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
154154
exit_on_error: bool = True,
155155
*,
156156
suggest_on_error: bool = False,
157-
color: bool = False,
157+
color: bool = True,
158158
) -> None: ...
159159
else:
160160
def __init__(

stdlib/compression/zstd/__init__.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ zstd_version_info: Final[tuple[int, int, int]]
3535
COMPRESSION_LEVEL_DEFAULT: Final = _zstd.ZSTD_CLEVEL_DEFAULT
3636

3737
class FrameInfo:
38+
__slots__ = ("decompressed_size", "dictionary_id")
3839
decompressed_size: int
3940
dictionary_id: int
4041
def __init__(self, decompressed_size: int, dictionary_id: int) -> None: ...

stdlib/concurrent/interpreters/_crossinterp.pyi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ if sys.version_info >= (3, 13): # needed to satisfy pyright checks for Python <
1212
classonly = classmethod
1313

1414
class UnboundItem:
15+
__slots__ = ()
1516
def __new__(cls) -> Never: ...
1617
@classonly
1718
def singleton(cls, kind: str, module: str, name: str = "UNBOUND") -> Self: ...

stdlib/concurrent/interpreters/_queues.pyi

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ if sys.version_info >= (3, 13): # needed to satisfy pyright checks for Python <
5151
timeout: SupportsIndex | None = None,
5252
*,
5353
unbounditems: _AnyUnbound | None = None,
54-
_delay: float = ...,
54+
_delay: float = 0.01,
5555
) -> None: ...
5656
def put_nowait(self, obj: object, *, unbounditems: _AnyUnbound | None = None) -> None: ...
57-
def get(self, timeout: SupportsIndex | None = None, *, _delay: float = ...) -> object: ...
57+
def get(self, timeout: SupportsIndex | None = None, *, _delay: float = 0.01) -> object: ...
5858
def get_nowait(self) -> object: ...

stdlib/io.pyi

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,9 @@ class TextIOBase(_TextIOBase, IOBase): ...
6767

6868
if sys.version_info >= (3, 14):
6969
class Reader(Protocol[_T_co]):
70+
__slots__ = ()
7071
def read(self, size: int = ..., /) -> _T_co: ...
7172

7273
class Writer(Protocol[_T_contra]):
74+
__slots__ = ()
7375
def write(self, data: _T_contra, /) -> int: ...

stdlib/pdb.pyi

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,11 @@ class Pdb(Bdb, Cmd):
131131
def completedefault(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ...
132132

133133
def do_commands(self, arg: str) -> bool | None: ...
134-
def do_break(self, arg: str, temporary: bool = ...) -> bool | None: ...
134+
if sys.version_info >= (3, 14):
135+
def do_break(self, arg: str, temporary: bool = False) -> bool | None: ...
136+
else:
137+
def do_break(self, arg: str, temporary: bool | Literal[0, 1] = 0) -> bool | None: ...
138+
135139
def do_tbreak(self, arg: str) -> bool | None: ...
136140
def do_enable(self, arg: str) -> bool | None: ...
137141
def do_disable(self, arg: str) -> bool | None: ...

0 commit comments

Comments
 (0)