Difficulty in understanding Decorators in Python

Needs more explanation

1 Like

Hello Komal,
Basically, we are firstly creating a nested function ‘A’ in which the outer function contains our desired function while the inner one contains four arguments, two for our original function and two as the username and password credentials, that is it.
Now, a decorator is nothing but a short statement of calling this above function without having to separately call it. We can simply write ‘@A’ and define the function for which we want an authorisation (username and password) below this.

I hope you get it now, I would suggest to watch the lecture one again or maybe try and implement it on your own, you will surely understand it.

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.