-
Notifications
You must be signed in to change notification settings - Fork 24
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
refactor: small cleanup #157
Conversation
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Pull Request Test Coverage Report for Build 9419751162Details
💛 - Coveralls |
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Pull Request Test Coverage Report for Build 9419952169Details
💛 - Coveralls |
Signed-off-by: nstarman <nstarman@users.noreply.github.com>
Pull Request Test Coverage Report for Build 9420047103Details
💛 - Coveralls |
Thanks again for the PR, @nstarman! This change looks good to me. One question about this: What’s the benefit of making Dispatcher a dataclass c.f. a normal class? Is it that you can set |
Slots means a tiny bit less overhead memory. But that does not impact anything we do because that’s sort of a singleton. I like data classes when they can help make the codec more clear , but in general they are a pain to work with because you lose control over init … ‘I’m not sure it’s the best idea to use them here. Though in that particular case it won’t hurt either. But it can add friction for future refactors |
Only here.
They reduce boilerplace, add introspection and interop tools (e.g. |
Thanks for the discussion, both! Since it’s a fairly small change and comes with some benefits (albeit minor ones), I think it’s worthwhile trying to make Dispatcher a dataclass. Should we later decide that we don’t like it after all, because it could make future changes more difficult as @PhilipVinc points out, it would be easy to make Dispatcher a normal class again. Will merge right away! :) Thanks again, @nstarman! |
Slowly adding typing.
This would be good to combine with #147.