From 35c31cb8ec0503fd8835a2f81aec22c403e780f7 Mon Sep 17 00:00:00 2001 From: TheArtur128 <88573504+TheArtur128@users.noreply.github.com> Date: Wed, 1 Nov 2023 18:48:03 +0700 Subject: [PATCH] ref(`eventually`): rename to `always` --- DOCS.md | 2 +- act/data_flow.py | 6 +++--- act/error_flow.py | 4 ++-- act/iteration.py | 4 ++-- act/objects.py | 6 +++--- tests/test_data_flow.py | 6 +++--- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/DOCS.md b/DOCS.md index af6d859..d3b3506 100644 --- a/DOCS.md +++ b/DOCS.md @@ -383,7 +383,7 @@ main(*range(10), a='a', b='b', x='x') ...all ```py -main = eventually(print, 42) # lambda *_, **__: print(42) +main = always(print, 42) # lambda *_, **__: print(42) main(*range(100), a='a', b='b', c='c', d='d') ``` ``` diff --git a/act/data_flow.py b/act/data_flow.py index d53ab5c..a94f6e9 100644 --- a/act/data_flow.py +++ b/act/data_flow.py @@ -20,7 +20,7 @@ __all__ = ( "rec", "io", - "eventually", + "always", "with_result", "dynamically", "fmt", @@ -70,7 +70,7 @@ def __call__(self, value: V, *args, **kwargs) -> V: """ ) @fun -class eventually(Decorator): +class always(Decorator): def __init__( self, action: Callable[Pm, R], @@ -389,7 +389,7 @@ def __call__(self, *args: Pm.args, **kwargs: Pm.kwargs) -> R: _CallableCustomPartialApplicationInfix( partial, name='to', - action_to_call=fun(will(_get) |then>> eventually), + action_to_call=fun(will(_get) |then>> always), ) ) diff --git a/act/error_flow.py b/act/error_flow.py index ad6b857..ac6ea76 100644 --- a/act/error_flow.py +++ b/act/error_flow.py @@ -3,7 +3,7 @@ from act.annotations import Pm, R, ErrorT from act.atomization import fun from act.contexting import contextual -from act.data_flow import by, to, eventually +from act.data_flow import by, to, always from act.partiality import partially from act.pipeline import bind_by, then from act.synonyms import try_, raise_ @@ -62,5 +62,5 @@ def catch( arguments. """ )( - eventually |to| raise_ + always |to| raise_ ) diff --git a/act/iteration.py b/act/iteration.py index 65e657b..a8d3344 100644 --- a/act/iteration.py +++ b/act/iteration.py @@ -4,7 +4,7 @@ from act.annotations import V, R from act.atomization import fun -from act.data_flow import eventually, by, to +from act.data_flow import always, by, to from act.error_flow import catch from act.pipeline import bind_by, then, on from act.synonyms import try_ @@ -26,7 +26,7 @@ )( fun( iter - |then>> (eventually |to| next) + |then>> (always |to| next) |then>> (try_ |by| to(catch(StopIteration, _get))) ) ) diff --git a/act/objects.py b/act/objects.py index 1536ab5..1e68e66 100644 --- a/act/objects.py +++ b/act/objects.py @@ -21,7 +21,7 @@ contextually, contexted, contextualizing, be, of ) from act.data_flow import ( - mergely, by, io, when, eventually, and_via_indexer, indexer_of, via_indexer + mergely, by, io, when, always, and_via_indexer, indexer_of, via_indexer ) from act.errors import ObjectTemplateError from act.error_flow import raising @@ -852,7 +852,7 @@ def _sculpture_property_of(descriptor: Any, value: Any) -> property: if hasattr(descriptor, "__get__"): sculpture_property = property( - eventually(descriptor.__get__, value, type(value)), + always(descriptor.__get__, value, type(value)), sculpture_property.fset, ) @@ -860,7 +860,7 @@ def _sculpture_property_of(descriptor: Any, value: Any) -> property: sculpture_property = property( sculpture_property.fget, sculpture_property.fset, - eventually(descriptor.__delete__, value), + always(descriptor.__delete__, value), ) return sculpture_property diff --git a/tests/test_data_flow.py b/tests/test_data_flow.py index e5b9ba2..e4c7b4a 100644 --- a/tests/test_data_flow.py +++ b/tests/test_data_flow.py @@ -7,9 +7,9 @@ from act.testing import case_of -test_eventually = case_of( - (lambda: eventually(lambda a, b: a + b, 100, 28)(1, 2, 3), 128), - (lambda: eventually(lambda a, b: a + b, 100, 28)(), 128), +test_always = case_of( + (lambda: always(lambda a, b: a + b, 100, 28)(1, 2, 3), 128), + (lambda: always(lambda a, b: a + b, 100, 28)(), 128), )