Dmitry Vakhrushev  committed f60d3e0 Draft

Fixed example for Python 3.x

  • Participants
  • Parent commits 216bc3f

Comments (0)

Files changed (1)

File copipes/

     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.
             >>> 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))