-
Notifications
You must be signed in to change notification settings - Fork 57
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
utility for handler decorator #91
Comments
Hmm; I'm not quite sure what you mean? What ideas do you have in mind? Do you mean a decorator to make writing custom decoraotrs that create event handlers a bit easier? |
The problem is that if you want to write a decorator which is applied after
|
Ahh I see; so what are you ideas then? Turn How else can decorators be extended in this way? |
If I'm not mistaken I think you can do something like this:
I think :) |
Ì think a class is not necessary?! |
circuits.web.controller.expose is the best example for the redundant things i want to get rid of:
|
Yeah I agree; this is less to do with function parameter inspection and more to do with: Do we need to send the I'm not sure how to solve this per se (yet) |
Got any ideas around this? I haven't really looked much further into this (yet). |
My description skills weren't that good in 2015. I explain again with a sample implementation:
So
And my implementation must always take the |
|
No, turning it into a class is optional. Making a subclass is not my need, see the last comment. in PR #311 I changed the handler decorator into a class, providing This would simplify my example to:
|
We should enhance the possibility to write decorators for handler-functions, as
@handler
copies meta information from the function and doesarginspect()
to check if the first argument is calledevent
- in that case theevent
is passed as argument.If the function gets decorated these meta information doesn't match the real underlying implementation.
We should provide a utility which developers can use so that they don't need to care about these internals when they want to write additional decorators.
Any further ideas on this? I have some ideas in mind which I will implement but I would like to hear what you think.
The text was updated successfully, but these errors were encountered: