Skip to content

Commit c963ff4

Browse files
committed
Improve the documentation
Make it more clear that `WithPrevious` is a composable predicate, to build new predicates. Signed-off-by: Leandro Lucarella <[email protected]>
1 parent 23912e9 commit c963ff4

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/frequenz/channels/experimental/_predicates.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# License: MIT
22
# Copyright © 2024 Frequenz Energy-as-a-Service GmbH
33

4-
"""Predicates to be used in conjuntion with `Receiver.filter()`."""
4+
"""Composable predicate to be cache and compare with the previous message."""
55

66

77
from typing import Callable, Final, Generic, TypeGuard
@@ -21,9 +21,9 @@ def __str__(self) -> str:
2121

2222

2323
class WithPrevious(Generic[ChannelMessageT]):
24-
"""A predicate to check if a message has a particular relationship with the previous one.
24+
"""A composable predicate to build predicates that can use also the previous message.
2525
26-
This predicate can be used to filter out messages based on a custom condition on the
26+
This predicate can be used to filter messages based on a custom condition on the
2727
previous and current messages. This can be useful in cases where you want to
2828
process messages only if they satisfy a particular condition with respect to the
2929
previous message.

0 commit comments

Comments
 (0)