We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7eaf3fa commit 8bd1f74Copy full SHA for 8bd1f74
README.md
@@ -760,3 +760,24 @@ processing at value 3
760
processing at value 4
761
[0, 2]
762
```
763
+
764
+# Chaining pipes
765
766
+You can combine multiple pipes into a new one:
767
768
+```python
769
+class ErrorDatabase:
770
+ def __init__(self):
771
+ self.lines = []
772
773
+ def filter_lines_by(self, predicate):
774
+ filtered_lines = list(self.lines | predicate)
775
+ # further processing of filtered_lines
776
+ # ...
777
+ return filtered_lines
778
779
+db = ErrorDatabase()
780
+# here we combine pipes into a new one to pass it to a function call
781
+expired_reports = has_error_code | reported_by_end_customer | older_than_days(30)
782
+errors = db.filter_lines_by(expired_reports)
783
+```
0 commit comments