Skip to content

Commit db2e1da

Browse files
Update docs
1 parent a674761 commit db2e1da

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
@@ -147,11 +147,12 @@ def filter(self,
147147
If the predicate returns false, Nothing is returned
148148
149149
.. code:: python
150-
>>> from returns.maybe import Maybe, Nothing, Some
150+
>>> def predicate(value):
151+
>>> return value % 2 == 0
151152
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
153+
>>> assert Some(5).filter(predicate) == Nothing
154+
>>> assert Some(6).filter(predicate) == Some(6)
155+
>>> assert Nothing.filter(predicate) == Nothing
155156
"""
156157
def lash(
157158
self,

0 commit comments

Comments
 (0)