diff --git a/stubs/gdb/gdb/__init__.pyi b/stubs/gdb/gdb/__init__.pyi index f24a9d633599..a6348fe9514a 100644 --- a/stubs/gdb/gdb/__init__.pyi +++ b/stubs/gdb/gdb/__init__.pyi @@ -5,7 +5,7 @@ import _typeshed from collections.abc import Callable, Iterator, Sequence from contextlib import AbstractContextManager -from typing import Protocol, final, overload +from typing import Literal, Protocol, final, overload from typing_extensions import TypeAlias import gdb.types @@ -23,7 +23,14 @@ STDOUT: int STDERR: int STDLOG: int -def execute(command: str, from_tty: bool = ..., to_string: bool = ...) -> str | None: ... +@overload +def execute(command: str, from_tty: bool = False, to_string: Literal[False] = False) -> None: ... +@overload +def execute(command: str, *, to_string: Literal[True]) -> str: ... +@overload +def execute(command: str, from_tty: bool, to_string: Literal[True]) -> str: ... +@overload +def execute(command: str, from_tty: bool = False, to_string: bool = False) -> str | None: ... def breakpoints() -> Sequence[Breakpoint]: ... def rbreak(regex: str, minsyms: bool = ..., throttle: int = ..., symtabs: Iterator[Symtab] = ...) -> list[Breakpoint]: ... def parameter(parameter: str, /) -> bool | int | str | None: ...