You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromtypingimportGeneric, TypeVarfromserdeimportserdeTrailingwhitespacefromserde.jsonimportfrom_json , to_jsonT=TypeVar("T")
@serdeclassBar(Generic[T]):
inner: T@serdeclassFoo(Generic[T]):
inner: T# This worksf1=Foo(10)
json=to_json(f1)
print(json)
print(from_json(Foo[int], json)) # Prints Foo(inner=10)# This does not workf2=Foo(Bar(10))
json=to_json(f2)
print(json)
# Foo(inner=Bar(inner=10)) is expected but prints Foo(inner={'inner': 10})print(from_json(Foo[Bar[int]], json))
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: