Skip to content

Commit

Permalink
typo and nested function typing
Browse files Browse the repository at this point in the history
  • Loading branch information
CucumisSativus committed Nov 28, 2021
1 parent 25f797a commit aa3a303
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
10 changes: 5 additions & 5 deletions returns/interfaces/filterable.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,12 @@ class FilterableN(MaybeLikeN[_FirstType, _SecondType, _ThirdType]):
>>> from returns.maybe import Nothing, Some
>>> from returns.pointfree import filter_
>>> def example(argument: int) -> bool:
>>> def is_even(argument: int) -> bool:
... return argument % 2 == 0
>>> assert filter_(example)(Some(5)) == Nothing
>>> assert filter_(example)(Some(6)) == Some(6)
>>> assert filter_(example)(Nothing) == Nothing
>>> assert filter_(is_even)(Some(5)) == Nothing
>>> assert filter_(is_even)(Some(6)) == Some(6)
>>> assert filter_(is_even)(Nothing) == Nothing
"""

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


#: Type alias for kinds with one type argument.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_maybe/test_maybe_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

def test_maybe_filter():
"""Ensures that .filter works correctly."""
def factory(argument):
def factory(argument: int) -> bool:
return argument % 2 == 0

assert Some(5).filter(factory) == Nothing
Expand Down

0 comments on commit aa3a303

Please sign in to comment.