I'm playing with Azure Functions and the main method is
def main(req: func.HttpRequest) -> func.HttpResponse:
Can someone please break down every part of this and explain what it means. Specifically what does req: func.HttpRequest
mean, is it forcing some data type for the parameter?
And what does -> func.HttpResponse
mean, is it forcing a return type?
I've never seen this syntax in Python before.
It defines a function named main
, which takes one parameter named req
that is of type func.HttpRequest
, and returns a value of type func.HttpResponse
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With