dict-typer
dict-typer copied to clipboard
Support detecting sequence type from other typed dicts if possible
Minimal example:
[{"items": []}, {"items": [1, 2, 3]}]
should produce
from typing import List
class RootTypeItem(TypedDict):
items: List[int]
RootType = List[RootTypeItem]
but now creates
from typing import List, Union
from typing_extensions import TypedDict
class RootItemType(TypedDict):
items: Union[List, List[int]]
RootType = List[RootItemType]