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 a674761 commit db2e1daCopy full SHA for db2e1da
returns/maybe.py
@@ -147,11 +147,12 @@ def filter(self,
147
If the predicate returns false, Nothing is returned
148
149
.. code:: python
150
- >>> from returns.maybe import Maybe, Nothing, Some
+ >>> def predicate(value):
151
+ >>> return value % 2 == 0
152
- >>> assert Some(5).filter(lambda x: x % 2 == 0) == Nothing
153
- >>> assert Some(6).filter(lambda x: x % 2 == 0) == Some(6)
154
- >>> assert Nothing.filter(lambda x: True) == Nothing
+ >>> assert Some(5).filter(predicate) == Nothing
+ >>> assert Some(6).filter(predicate) == Some(6)
155
+ >>> assert Nothing.filter(predicate) == Nothing
156
"""
157
def lash(
158
self,
0 commit comments