4.2. spy.decorators¶
This module contains various function decorators for use in spy fragments.
- @spy.decorators.accumulate¶
- --accumulate, -a¶
Accumulate values into an iterator by calling spy.collect(), and pass that to the fragment.
This can be used to write a fragment which executes at most once while passing data through:
-ma 'x = y;'
- @spy.decorators.filter¶
- --filter, -f¶
Use the decorated fragment as a predicate—only elements for which the fragment returns a true value will be passed through.
- @spy.decorators.many¶
- --many, -m¶
Call spy.many() with the result of the fragment.