Overload gdb.execute return type (#11638)

This commit is contained in:
peace-maker
2024-03-21 17:06:58 +01:00
committed by GitHub
parent 3d26992d15
commit 9dcadd2d57

View File

@@ -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: ...