Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added accidentally-uncommitted docstring goodness.

  • Loading branch information...
commit 21ec6568f32e1ea4ec4ba94be18213a8bd5f866b 1 parent 1bea7a9
@zacharyvoase authored
Showing with 34 additions and 0 deletions.
  1. +34 −0 src/calabash/pipeline.py
View
34 src/calabash/pipeline.py
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-
from functools import wraps
+import itertools
class PipeLine(object):
@@ -80,6 +81,39 @@ class PipeLine(object):
4
5
6
+
+ Some operators are overridden to provide pipeline combinators (methods
+ which take multiple pipelines and return a new pipeline). For example,
+ multiplying two pipelines gets you their cross product::
+
+ >>> pl = my_generator() | (adder(3) * adder(6))
+ >>> pl
+ <PipeLine: my_generator | adder * adder>
+ >>> for item in pl:
+ ... print item
+ (4, 7)
+ (4, 8)
+ (4, 9)
+ (5, 7)
+ (5, 8)
+ (5, 9)
+ (6, 7)
+ (6, 8)
+ (6, 9)
+
+ Adding two pipelines will chain the same input through both::
+
+ >>> pl = my_generator() | (adder(3) + adder(12))
+ >>> pl
+ <PipeLine: my_generator | adder + adder>
+ >>> for item in pl:
+ ... print item
+ 4
+ 5
+ 6
+ 13
+ 14
+ 15
"""
__slots__ = ('coro_func',)
Please sign in to comment.
Something went wrong with that request. Please try again.