Closed as not planned
Description
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.