Part of twisted.flow.pipe View Source View In Hierarchy
flow equivalent to filter: Filter(function, source, ... )
Yield those elements from a source stage for which a function returns true. If the function is None, the identity function is assumed, that is, all items yielded that are false (zero or empty) are discarded.
For example:
def odd(val):
if val % 2:
return True
def range():
yield 1
yield 2
yield 3
yield 4
source = flow.Filter(odd,range)
printFlow(source)
Split Table into Classes Show Methods in One Table
| Line # | Kind | Name | Docs |
|---|---|---|---|
| 73 | Method | __init__ | Undocumented |
| 77 | Method | process | process implemented by the pipe |
Inherited from Pipe:
| Line # | Kind | Name | Docs |
|---|---|---|---|
| 24 | Method | _yield | executed during a yield statement by previous stage |
Inherited from Stage (via Pipe):
| Line # | Kind | Name | Docs |
|---|---|---|---|
| 170 | Method | __iter__ | Undocumented |
| 173 | Method | next | return current result |
| Line # | Kind | Name | Docs |
|---|---|---|---|
| 73 | Method | __init__ | Undocumented |
| 170 | Method | __iter__ | Undocumented |
| 173 | Method | next | return current result |
| 77 | Method | process | process implemented by the pipe |
| 24 | Method | _yield | executed during a yield statement by previous stage |
process implemented by the pipe
Take a set of possibly empty results and sets the member variables: results, stop, or failure appropriately