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