Skip to content

Commit

Permalink
Handle TypeVars after all
Browse files Browse the repository at this point in the history
  • Loading branch information
Tinche committed Mar 5, 2024
1 parent a995956 commit 1b857b6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/cattrs/gen/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -680,6 +680,8 @@ def make_iterable_unstructure_fn(
# against IndexError.
if getattr(cl, "__args__", None) not in (None, ()):
type_arg = cl.__args__[0]
if isinstance(type_arg, TypeVar):
type_arg = getattr(type_arg, "__default__", Any)
handler = converter.get_unstructure_hook(type_arg, cache_result=False)
if handler == identity:
# Save ourselves the trouble of iterating over it all.
Expand Down

0 comments on commit 1b857b6

Please sign in to comment.