MCPcopy Index your code
hub / github.com/reactive-python/reactpy / _get_children_info

Function _get_children_info

src/py/reactpy/reactpy/core/layout.py:726–747  ·  view source on GitHub ↗
(children: list[VdomChild])

Source from the content-addressed store, hash-verified

724
725
726def _get_children_info(children: list[VdomChild]) -> Sequence[_ChildInfo]:
727 infos: list[_ChildInfo] = []
728 for index, child in enumerate(children):
729 if child is None:
730 continue
731 elif isinstance(child, dict):
732 child_type = _DICT_TYPE
733 key = child.get("key")
734 elif isinstance(child, ComponentType):
735 child_type = _COMPONENT_TYPE
736 key = child.key
737 else:
738 child = f"{child}"
739 child_type = _STRING_TYPE
740 key = None
741
742 if key is None:
743 key = index
744
745 infos.append((child, child_type, key))
746
747 return infos
748
749
750_ChildInfo: TypeAlias = tuple[Any, "_ElementType", Key]

Calls 1

getMethod · 0.45

Tested by

no test coverage detected