Skip to content

Commit

Permalink
Overload gdb.execute return type (#11638)
Browse files Browse the repository at this point in the history
  • Loading branch information
peace-maker authored Mar 21, 2024
1 parent 3d26992 commit 9dcadd2
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions stubs/gdb/gdb/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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: ...
Expand Down

0 comments on commit 9dcadd2

Please sign in to comment.