Skip to content

Commit

Permalink
Fixed iterator/iterable support for generators in TypeChecker
Browse files Browse the repository at this point in the history
Fixes #77.
  • Loading branch information
agronholm committed Sep 15, 2019
1 parent d62db01 commit c684a1c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion typeguard/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -901,7 +901,7 @@ def __call__(self, frame, event: str, arg) -> None: # pragma: no cover
return_type_hint = memo.type_hints['return']
if return_type_hint is not None:
origin = getattr(return_type_hint, '__origin__', None)
if origin in (collections.abc.Generator, Generator):
if origin in generator_origin_types:
# Check the types of the yielded values
memo.type_hints['return'] = return_type_hint.__args__[0]
else:
Expand Down

0 comments on commit c684a1c

Please sign in to comment.