Currently, we would expect nested_type to return a typeddict type annotation on a TypedDict instance.
from typing import TypedDict
from effectful.internals.unification import nested_type
class UserTD(TypedDict):
name: str
age: int
print("nested_type(UserTD(name='a', age=1)).value ->", nested_type(UserTD(name='a', age=1)).value)
Result:
nested_type(UserTD(name='a', age=1)).value -> <class 'dict'>
One difficulty is that the TypedDict instance at runtime is just a dict. Inferring types is possible, but we might not be able to recover the schema fully.
Currently, we would expect
nested_typeto return a typeddict type annotation on aTypedDictinstance.Result:
One difficulty is that the TypedDict instance at runtime is just a
dict. Inferring types is possible, but we might not be able to recover the schema fully.