INNER CODE UNIT · Python
has_children
mongodb/mongo-c-driver · lldb_bson.py:276
def has_children(self) -> bool:
"""Optimization opportunity for LLDB if it knows it doesn't need to ask"""
return self.__enable_synthetic__ and self.num_children() != 0
@print_errors
@override
def get_child_at_index(self, pos: int) -> SBValue:
"""
Obtain the synthetic child of this value at index 'pos'.
"""
# LLDB sometimes calls us with a child that we don't have?
if pos >= len(self.__children):
print(f'NOTE: lldb called get_child_at_index({pos}), but we only have {len(self.__children)} children')
return SBValue()
# Get the child:
nth = self.__children[pos]
# If not a tuple:
if not isinstance(nth, tuple):