Skip to content

Commit

Permalink
We can start the generator outside the func
Browse files Browse the repository at this point in the history
  • Loading branch information
cjrh committed Oct 23, 2021
1 parent bbd6079 commit 430d025
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions excitertools.py
Original file line number Diff line number Diff line change
Expand Up @@ -3870,10 +3870,10 @@ def send_also(self, collector: Generator) -> "Iter":
live at least as long as the iterator feeding it.
"""
def func(v):
if inspect.getgeneratorstate(collector) == 'GEN_CREATED':
next(collector)
if inspect.getgeneratorstate(collector) == 'GEN_CREATED':
next(collector)

def func(v):
collector.send(v)

return self.side_effect(func)
Expand Down

0 comments on commit 430d025

Please sign in to comment.