mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-06 21:43:59 +08:00
Add some defaults and __slots__ for 3.14 (#14622)
This commit is contained in:
@@ -28,6 +28,20 @@ if sys.version_info >= (3, 14):
|
||||
|
||||
@final
|
||||
class ForwardRef:
|
||||
__slots__ = (
|
||||
"__forward_is_argument__",
|
||||
"__forward_is_class__",
|
||||
"__forward_module__",
|
||||
"__weakref__",
|
||||
"__arg__",
|
||||
"__globals__",
|
||||
"__extra_names__",
|
||||
"__code__",
|
||||
"__ast_node__",
|
||||
"__cell__",
|
||||
"__owner__",
|
||||
"__stringifier_dict__",
|
||||
)
|
||||
__forward_is_argument__: bool
|
||||
__forward_is_class__: bool
|
||||
__forward_module__: str | None
|
||||
|
||||
+1
-1
@@ -154,7 +154,7 @@ class ArgumentParser(_AttributeHolder, _ActionsContainer):
|
||||
exit_on_error: bool = True,
|
||||
*,
|
||||
suggest_on_error: bool = False,
|
||||
color: bool = False,
|
||||
color: bool = True,
|
||||
) -> None: ...
|
||||
else:
|
||||
def __init__(
|
||||
|
||||
@@ -35,6 +35,7 @@ zstd_version_info: Final[tuple[int, int, int]]
|
||||
COMPRESSION_LEVEL_DEFAULT: Final = _zstd.ZSTD_CLEVEL_DEFAULT
|
||||
|
||||
class FrameInfo:
|
||||
__slots__ = ("decompressed_size", "dictionary_id")
|
||||
decompressed_size: int
|
||||
dictionary_id: int
|
||||
def __init__(self, decompressed_size: int, dictionary_id: int) -> None: ...
|
||||
|
||||
@@ -12,6 +12,7 @@ if sys.version_info >= (3, 13): # needed to satisfy pyright checks for Python <
|
||||
classonly = classmethod
|
||||
|
||||
class UnboundItem:
|
||||
__slots__ = ()
|
||||
def __new__(cls) -> Never: ...
|
||||
@classonly
|
||||
def singleton(cls, kind: str, module: str, name: str = "UNBOUND") -> Self: ...
|
||||
|
||||
@@ -51,8 +51,8 @@ if sys.version_info >= (3, 13): # needed to satisfy pyright checks for Python <
|
||||
timeout: SupportsIndex | None = None,
|
||||
*,
|
||||
unbounditems: _AnyUnbound | None = None,
|
||||
_delay: float = ...,
|
||||
_delay: float = 0.01,
|
||||
) -> None: ...
|
||||
def put_nowait(self, obj: object, *, unbounditems: _AnyUnbound | None = None) -> None: ...
|
||||
def get(self, timeout: SupportsIndex | None = None, *, _delay: float = ...) -> object: ...
|
||||
def get(self, timeout: SupportsIndex | None = None, *, _delay: float = 0.01) -> object: ...
|
||||
def get_nowait(self) -> object: ...
|
||||
|
||||
@@ -67,7 +67,9 @@ class TextIOBase(_TextIOBase, IOBase): ...
|
||||
|
||||
if sys.version_info >= (3, 14):
|
||||
class Reader(Protocol[_T_co]):
|
||||
__slots__ = ()
|
||||
def read(self, size: int = ..., /) -> _T_co: ...
|
||||
|
||||
class Writer(Protocol[_T_contra]):
|
||||
__slots__ = ()
|
||||
def write(self, data: _T_contra, /) -> int: ...
|
||||
|
||||
+5
-1
@@ -131,7 +131,11 @@ class Pdb(Bdb, Cmd):
|
||||
def completedefault(self, text: str, line: str, begidx: int, endidx: int) -> list[str]: ...
|
||||
|
||||
def do_commands(self, arg: str) -> bool | None: ...
|
||||
def do_break(self, arg: str, temporary: bool = ...) -> bool | None: ...
|
||||
if sys.version_info >= (3, 14):
|
||||
def do_break(self, arg: str, temporary: bool = False) -> bool | None: ...
|
||||
else:
|
||||
def do_break(self, arg: str, temporary: bool | Literal[0, 1] = 0) -> bool | None: ...
|
||||
|
||||
def do_tbreak(self, arg: str) -> bool | None: ...
|
||||
def do_enable(self, arg: str) -> bool | None: ...
|
||||
def do_disable(self, arg: str) -> bool | None: ...
|
||||
|
||||
Reference in New Issue
Block a user