Skip to content

Commit

Permalink
Enhance generic lists deserialization
Browse files Browse the repository at this point in the history
  • Loading branch information
alecandido committed Mar 22, 2023
1 parent b9cabf5 commit 3175185
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/eko/io/dictlike.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ def load_typing(type_, value):
return None
raise TypeError

if issubclass(origin, (list, typing.Generic)):
T = typing.get_args(type_)[0]
return origin([load_field(T, x) for x in value])

return load_field(origin, value)


Expand Down

0 comments on commit 3175185

Please sign in to comment.