t.f.s.Map(Stage) : class documentation

Part of twisted.flow.stage View Source View In Hierarchy

Known subclasses: twisted.flow.stage.Zip

flow equivalent to map: Map(function, stage, ... )

Apply a function to every item yielded and yield the results. If additional stages are passed, the function must take that many arguments and is applied to the items of all lists in parallel. If a list is shorter than another, it is assumed to be extended with None items. If the function is None, the identity function is assumed; if there are multiple list arguments, Map stage returns a sequence consisting of tuples containing the corresponding items from all lists.

For example:
   def fn(val):
       return val + 10

   source = flow.Map(fn,range(4))
Method __init__ Undocumented
Method _yield executed during a yield statement by previous stage

Inherited from Stage:

Method __iter__ Undocumented
Method next return current result
def __init__(self, func, stage, *stages): (source)
def _yield(self): (source)

executed during a yield statement by previous stage

This method is private within the scope of the flow module, it is used by one stage in the flow to ask a subsequent stage to produce its value. The result of the yield is then stored in self.result and is an instance of Failure if a problem occurred.
API Documentation for Twisted, generated by pydoctor at 2011-10-27 16:02:37.