Since I'm working a lot with type hints in Python I came across the scenario that a recursive function accepts dict
, with str
as keys and int
or dict
as value (Dict[str, Union[int, Dict[...]]
). The problem at this point is that the possible dict
-value has also str
as keys and int
or dict
as value (Dict[str, Union[int, Dict[Dict[str, Union[int, Dict[...]]]]
).
However, I don't know which depth the passed dictionary has. Is there any possibility to visualize this repetitive pattern with type hints?