Commits

Dmitry Vakhrushev committed f60d3e0 Draft

Fixed example for Python 3.x

Comments (0)

Files changed (1)

copipes/__init__.py

     @contextmanager
     def fork(self, worker, *pipes):
         """
-        Connect to pipeline forked coroutine.
+        Connect to pipeline forked coroutine.  The method is a context manager.
+        The first argument is a coroutine.  If the second one is a number, then
+        this number of pipelines will be created and passed to coroutine as
+        positional arguments during initialization.  If the second argument and
+        next ones are strings, then coroutine will be initialized using
+        keyword arguments.
 
         Examples:
 
             >>> odds = []
             >>> p = pipeline()
             >>> with p.fork(split, 2) as (even, odd):
+            ...     # ``p.fork(split, 'even', 'odd')`` is also correct
             ...     even.connect(collect.params(evens))
             ...     odd.connect(collect.params(odds))