Skip to content

Commit 0b3a3fc

Browse files
Update docs
1 parent db2f333 commit 0b3a3fc

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

returns/maybe.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,12 @@ def filter(self,
149149
If the predicate returns false, Nothing is returned
150150
151151
.. code:: python
152-
>>> from returns.maybe import Maybe, Nothing, Some
152+
>>> def predicate(value):
153+
>>> return value % 2 == 0
153154
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
155+
>>> assert Some(5).filter(predicate) == Nothing
156+
>>> assert Some(6).filter(predicate) == Some(6)
157+
>>> assert Nothing.filter(predicate) == Nothing
157158
"""
158159
def lash(
159160
self,

0 commit comments

Comments
 (0)