Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consider replacing ChangedOnly by more composable predicates #345

Closed
llucax opened this issue Nov 29, 2024 · 1 comment
Closed

Consider replacing ChangedOnly by more composable predicates #345

llucax opened this issue Nov 29, 2024 · 1 comment
Labels
part:experimental Affects the experimental package type:enhancement New feature or enhancement visitble to users
Milestone

Comments

@llucax
Copy link
Contributor

llucax commented Nov 29, 2024

What's needed?

It still seems hard to justify the special case, in particular because if we add more simple predicates it could be really easy to get ChangedOnly while allowing to create more types of predicates more easily.

Specially once #354 and #355 are implemented.

Proposed solution

If we add these:

def is_equal(prev_message: object, new_message: object) -> bool:
    """Return whether `prev_message` is equal to `new_message`."""
    return prev_message == new_message


def is_same(prev_message: object, new_message: object) -> bool:
    """Return whether `prev_message` is the same instance as `new_message`."""
    return prev_message is new_message

Then ChangedOnly is basically is drop_while(is_equal), which it is a bit more verbose, but actually makes it more obvious what's really going on.

@llucax llucax added part:❓ We need to figure out which part is affected priority:❓ We need to figure out how soon this should be addressed type:enhancement New feature or enhancement visitble to users part:experimental Affects the experimental package and removed part:❓ We need to figure out which part is affected priority:❓ We need to figure out how soon this should be addressed labels Nov 29, 2024
@llucax llucax modified the milestones: Untriaged, Dropped Nov 29, 2024
@llucax
Copy link
Contributor Author

llucax commented Dec 2, 2024

We will actually remove ChangedOnly and not add any new predicates, they are just too trivial to be worth adding.

@llucax llucax closed this as not planned Won't fix, can't repro, duplicate, stale Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
part:experimental Affects the experimental package type:enhancement New feature or enhancement visitble to users
Projects
None yet
Development

No branches or pull requests

1 participant