in the above code if i use wrapper() instead of return wrapper
it gives me an error in the Authentication line asking for username and password parameters
what difference did this return statement make ?
bcz i didnt give the arguments username and password this time either …then why did i not get an error and what value is being returned by the function login_required then?
Python Functions-Decorators
Hey @devchopra999_11c6416ab7f09bbf,
So its basically working like when you returning wrapper its not calling wrapper instead this is copying wrapper function in authentication and when you are calling authentication function then wrapper function is called but when you are returning wrapper() its calling the wrapper function when login_required is called thus asking for username and password.
1 Like
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.