Skip to content

Commit f4bf1be

Browse files
typo and nested function typing
1 parent d7aae45 commit f4bf1be

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

returns/interfaces/filterable.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ class FilterableN(MaybeLikeN[_FirstType, _SecondType, _ThirdType]):
2727
>>> from returns.maybe import Nothing, Some
2828
>>> from returns.pointfree import filter_
2929
30-
>>> def example(argument: int) -> bool:
30+
>>> def is_even(argument: int) -> bool:
3131
... return argument % 2 == 0
3232
33-
>>> assert filter_(example)(Some(5)) == Nothing
34-
>>> assert filter_(example)(Some(6)) == Some(6)
35-
>>> assert filter_(example)(Nothing) == Nothing
33+
>>> assert filter_(is_even)(Some(5)) == Nothing
34+
>>> assert filter_(is_even)(Some(6)) == Some(6)
35+
>>> assert filter_(is_even)(Nothing) == Nothing
3636
3737
"""
3838

@@ -41,7 +41,7 @@ def filter(
4141
self: _FilterableType,
4242
predicate: Callable[[_FirstType], bool],
4343
) -> Kind1[_FilterableType, _FirstType]:
44-
"""Applies 'predicate' to the result fo a previous computation."""
44+
"""Applies 'predicate' to the result of a previous computation."""
4545

4646

4747
#: Type alias for kinds with one type argument.

tests/test_maybe/test_maybe_filter.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
def test_maybe_filter():
55
"""Ensures that .filter works correctly."""
6-
def factory(argument):
6+
def factory(argument: int) -> bool:
77
return argument % 2 == 0
88

99
assert Some(5).filter(factory) == Nothing

0 commit comments

Comments
 (0)