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

MNT: replace isinstance if-else blocks with single-dispatch generics #196

Open
tangkong opened this issue Aug 11, 2023 · 0 comments
Open

Comments

@tangkong
Copy link
Contributor

https://docs.python.org/3/library/functools.html#functools.singledispatch
It could be used to remove the if/isinstance block boilerplate here. (Ken) had used it (a total of once) in the pvaccess stuff in caproto and thought it was neat.

Originally posted by @klauer in #193 (comment)

This could be the right programming pattern here, but to the best of my understanding it's not adding much in terms of functionality. Maybe this helps readability.

This would have to be applied to all the other places we isinstance-spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant