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

Event versioning #2

Open
dzervas opened this issue Oct 30, 2018 · 1 comment
Open

Event versioning #2

dzervas opened this issue Oct 30, 2018 · 1 comment

Comments

@dzervas
Copy link
Member

dzervas commented Oct 30, 2018

Event versioning should be added so that changing a single call arg does not break all the hooks

@dzervas
Copy link
Member Author

dzervas commented Jan 4, 2020

Example usage:

from hooker import EVENTS, hook
EVENTS.append("ahook")

@hook("ahook", version="0.1")
def a():
    return "a"

@hook("ahook", version="0.2")
def b():
    return "b"

EVENTS["ahook"]["0.1"]()
EVENTS["ahook"]["0.2"]()
EVENTS["ahook"]()  # What happens here?

What should EVENTS["ahook"]() do? should it call the "latest" version? If yes how can I order a version? what if the "version" is blabla and caca? Alphabetical order?

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