diff --git a/meiga/alias.py b/meiga/alias.py index 270d46a..9a3d6a9 100644 --- a/meiga/alias.py +++ b/meiga/alias.py @@ -1,4 +1,4 @@ -from typing import Generic, cast +from typing import Any, Generic, cast from meiga.error import Error from meiga.result import TF, TS, Result @@ -19,3 +19,4 @@ def __init__(self, error: TF = cast(TF, Error())) -> None: NotImplementedMethodError = isFailure BoolResult = Result[bool, Error] +AnyResult = Result[Any, Error] diff --git a/meiga/public_api.py b/meiga/public_api.py index 53205ad..f72185c 100644 --- a/meiga/public_api.py +++ b/meiga/public_api.py @@ -5,6 +5,7 @@ from . import decorators from .alias import ( + AnyResult, BoolResult, Failure, NotImplementedMethodError, @@ -26,6 +27,7 @@ "isFailure", "NotImplementedMethodError", "BoolResult", + "AnyResult", "OnSuccessHandler", "OnFailureHandler", ] diff --git a/tests/unit/test_alias.py b/tests/unit/test_alias.py index ea38d53..524d45f 100644 --- a/tests/unit/test_alias.py +++ b/tests/unit/test_alias.py @@ -60,3 +60,9 @@ def should_unwrap_a_given_type_value(self, value): assert type(result.unwrap()) is type(value) assert type(success.unwrap()) is type(value) + + def should_check_bool_result_is_available_in_the_public_api(self): + from meiga import BoolResult # noqa + + def should_check_any_result_is_available_in_the_public_api(self): + from meiga import AnyResult # noqa