Skip to content

Having difficulty with decorators - trying to get Google Cloud Functions working #2455

Answered by Kodiologist
nbrandaleone asked this question in Q&A
Discussion options

You must be logged in to vote

The implicit call works the same as in Hy as in Python. You need to write (defn [functions-framework.http] …) or (defn [(. functions-framework http)] …) in Hy to get @functions_framework.http in Python.

Don't forget that decorators are little more than syntactic sugar for higher-order functions anyway. You can always say e.g. (setv hello (functions-framework.http (fn [request] …))).

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@nbrandaleone
Comment options

@goyalyashpal
Comment options

@nbrandaleone
Comment options

Answer selected by nbrandaleone
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants