- Notifications
You must be signed in to change notification settings - Fork5.7k
Refactor handling of message vs update filters#2032
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I'm very tired, but found a couple of thing that might need changes. Mostly just looks good tho!
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
* Refactor handling of message vs update filters* address review
* Refactor handling of message vs update filters* address review
As mentioned offline:
update_filter
is a bit unsatisfactory to me. E.g. it leads to irritation with users (see#1595) and makes typing hard (see#1920)What this PR does is:
BaseFilter.__call__
an abstract method and implement two subclasses:MessageFilter
andUpdateFilter
, each of which will take care of passing the right object tofilter()
update_filter
, make the filters inherit from those.BaseFilter
toMessage/UpdateFilter
in order to make typing even more clear. This makes it breaking, butBaseFilter
toMessageHandler
is not too bad. Leavingupdate_filter = True
won't even hurt …Offline I also mentioned dropping
data_filter
, but that was nonsense, as we need that for the short circuit logic of the filtersCloses#1595 and#1596