Closed wontonst closed 6 years ago
Same issue if the user iterates thru the generator again on @ensure
@deadpixi I have a possible solution up at #5 please have a look.
@wontonst Please look at my comments on the PR, and check out the new rewrite
and transform
functionality in the master branch and let me know if that solves your problem.
I found an issue with this library.
If you pass a generator to a function that has an
@require
which loops through the generator to do some verification, the pointer to the empty generator is returned.Here's a minimal repro:
Smells like somewhere in the code we need to check
inspect.isgeneratorfunction
and if so,original_generator = itertools.tee(the_generator)
and pass that to the function instead of the original generator