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

Rework vkwave.bots.core.dispatching.cast #32

Closed
prostomarkeloff opened this issue Apr 12, 2020 · 0 comments
Closed

Rework vkwave.bots.core.dispatching.cast #32

prostomarkeloff opened this issue Apr 12, 2020 · 0 comments
Assignees
Labels
bots-core VKWave bot framework high-priority High priority issues
Milestone

Comments

@prostomarkeloff
Copy link
Owner

Getting cast by type(value) looks bad.
It should have list of handlers that will inspect object each by each and if handlers don't return any cast, caster will run default implementation.

def cast(self, obj: typing.Any):
    result = self.from_handlers(obj) or self.default(obj)
    return result
@prostomarkeloff prostomarkeloff added bots-core VKWave bot framework high-priority High priority issues labels Apr 12, 2020
@prostomarkeloff prostomarkeloff added this to the First release milestone Apr 12, 2020
@prostomarkeloff prostomarkeloff self-assigned this Apr 12, 2020
prostomarkeloff added a commit that referenced this issue Apr 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bots-core VKWave bot framework high-priority High priority issues
Projects
None yet
Development

No branches or pull requests

1 participant