Skip to content

Commit

Permalink
ref(eventually): rename to always
Browse files Browse the repository at this point in the history
  • Loading branch information
emptybutton committed Nov 1, 2023
1 parent 098dabc commit 35c31cb
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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')
```
```
Expand Down
6 changes: 3 additions & 3 deletions act/data_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
__all__ = (
"rec",
"io",
"eventually",
"always",
"with_result",
"dynamically",
"fmt",
Expand Down Expand Up @@ -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],
Expand Down Expand Up @@ -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),
)
)

Expand Down
4 changes: 2 additions & 2 deletions act/error_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand Down Expand Up @@ -62,5 +62,5 @@ def catch(
arguments.
"""
)(
eventually |to| raise_
always |to| raise_
)
4 changes: 2 additions & 2 deletions act/iteration.py
Original file line number Diff line number Diff line change
Expand Up @@ -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_
Expand All @@ -26,7 +26,7 @@
)(
fun(
iter
|then>> (eventually |to| next)
|then>> (always |to| next)
|then>> (try_ |by| to(catch(StopIteration, _get)))
)
)
Expand Down
6 changes: 3 additions & 3 deletions act/objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -852,15 +852,15 @@ 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,
)

if hasattr(descriptor, "__delete__"):
sculpture_property = property(
sculpture_property.fget,
sculpture_property.fset,
eventually(descriptor.__delete__, value),
always(descriptor.__delete__, value),
)

return sculpture_property
Expand Down
6 changes: 3 additions & 3 deletions tests/test_data_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)


Expand Down

0 comments on commit 35c31cb

Please sign in to comment.