From aa3a30341ba25c13df94f9559c6fd81c727f2d30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Gutowski?= Date: Sun, 28 Nov 2021 14:57:28 +0100 Subject: [PATCH] typo and nested function typing --- returns/interfaces/filterable.py | 10 +++++----- tests/test_maybe/test_maybe_filter.py | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/returns/interfaces/filterable.py b/returns/interfaces/filterable.py index a85e65a9c..92ba7f9e2 100644 --- a/returns/interfaces/filterable.py +++ b/returns/interfaces/filterable.py @@ -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 """ @@ -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. diff --git a/tests/test_maybe/test_maybe_filter.py b/tests/test_maybe/test_maybe_filter.py index 0254a3fd7..d24bb7fb5 100644 --- a/tests/test_maybe/test_maybe_filter.py +++ b/tests/test_maybe/test_maybe_filter.py @@ -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