Skip to content

Commit

Permalink
Enable SupportsChildren protocol to return Python str values.
Browse files Browse the repository at this point in the history
GDB permits a pretty printer's children() method to return either a
gdb.Value or any Python type which a gdb.Value can be constructed from.
  • Loading branch information
visemet committed Sep 23, 2023
1 parent a0a6866 commit bd5214d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stubs/gdb/printing.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import typing
from gdb._lazy_string import LazyString
from gdb._objfile import Objfile
from gdb._progspace import Progspace
from gdb._value import Value
from gdb._value import ConstructibleFrom, Value


class _SupportsDisplayHint(typing.Protocol):
Expand All @@ -44,7 +44,7 @@ class _SupportsToString(typing.Protocol):
class _SupportsChildren(typing.Protocol):

@abc.abstractmethod
def children(self) -> typing.Iterator[typing.Tuple[str, Value]]:
def children(self) -> typing.Iterator[typing.Tuple[str, ConstructibleFrom]]:
raise NotImplementedError


Expand Down

0 comments on commit bd5214d

Please sign in to comment.