-
Notifications
You must be signed in to change notification settings - Fork 127
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
Decorators for function declarations? #31
Comments
Thanks! Suggestion: a brief section in the proposal that explains why function declarations can’t be decorated. |
@rauschma Thanks for raising this again. You're absolutely right, the proposal should address this. Hopefully that will highlight the issue so that smart people can figure out how functions can be decorated. The only argument I have seen against decorating function is related to the hoisting issue. However, there is a proposal for dealing with this in the thread on issue #4. Briefly, that proposal is that even if the function is hoisted, the decorator is applied at the point where it is declared. I would like to hear from the proposers why they think this won't work. |
Decorators would be very useful for function declarations (incl. generator function declarations). I’d either add that feature to the proposal or mention (e.g. in an FAQ section) why it was postponed/dropped. Python’s decorators work for function declarations.
Use case:
The text was updated successfully, but these errors were encountered: