I searched many tutorials for learning decorators but none of them are able to understand me the concept of decorators, but finally my search is over and I do not need any further exploration of decorators. Thanks a lot for this wonderful explanations ❤❤❤❤
Everyone unique..so maintain your own teaching style... Target is like result do not care I am age 53 yrs. but student not for exam but for self satisfaction..."योग : कर्म 15:17 सुकौशलम्"
learning python day 13 - present sir 00:02 Decorators in Python are like tollbooths on a road. 02:00 Decorators are like a decoration item, applied to functions to perform additional work. 06:11 Decorators in Python allow modifying or extending behavior of functions or methods 08:07 Decorators in Python allow you to add functionality to an existing function. 12:11 Decorators in Python allow you to modify the behavior of a function 14:11 Decorators in Python allow you to wrap a function inside another function. 18:03 Decorators in Python act as wrappers for functions. 19:55 Decorators in Python provide a way to modify or extend the behavior of functions or methods at the time of their definition. 23:31 Decorators in Python can be used to perform advanced code operations with ease. 25:16 Using formatted strings to separate key and value in decorators 28:58 Decorators in Python can be used for customization and memory optimization 30:53 Decorators in Python allow efficient modification of functions. 34:21 Using decorators to implement caching for functions in Python 36:16 Decorators in Python are like tollbooths for functions, adding functionality without changing the original function.
I really enjoy your Python videos on the "Chai Aur Code" channel. Your teaching style is excellent, and your industry-level programming content is incredibly valuable. Please continue making these videos; they're helping us understand real-world frameworks much more easily. We're all here to support your channel's growth and would love to see even more industry-level programming content. Keep up the great work!
cache_values haven't printed in the second call because the print(cache_values) statement is outside the wrapper function. It gets executed only once when the cache decorator is first applied to the long_running_function. After that, the print statement is not re-executed when you call the decorated function. To print the cache values during each function call, move print(cache_values) statement inside the wrapper function.
Thanks for explanation but, why this behave like, those python knows this is decorator function and treat it differently. And if, decorator is function why only func is passed in first function and arguments in inner function.
import time def timer(func): def wrapper(*args,**kwargs): #*args=[10] and **kwargs={} start=time.time() func(*args,**kwargs) #calculate_time(10) *args and **kwargs means you are unpacking the both end=time.time() return end-start #result which is approx return wrapper @timer def calculate_time(n): #calculate_time=timer(calculate_time) return wrapper time.sleep(n) a=1+2 return a calculate_time(5) #wrapper(10) print(calculate_time(5)) #value returned from return end-start which is 5 //For reference
learned decorators and really loved it... and indeed it was hard but you explained it so easily, thank you Sir.. and if I got stuck somewhere, I will return to revise this topic
We don't want only gyaan ki baatein, we want to learn as you said (so we are doing, thanks to your amazing content). Itni clarity to content lenses lga kr nahi aati jitni aapke videos dekh kr aajati hai😂😂
I was worried in 3rd example as how will multiple args will become key for 'cache_value' dictionary. But it's a tuple which is immutable, so it can be key in dictionary. Awesome!
Honestly I like the way you teach the concepts . Specially the question and answers it gives good clarity about the topic and side by side a practical approach is done
outstanding churcha about decorators was excellent. I loved it, but I was a bit disappointed that you didn't use the term 'churcha' even once throughout the entire lecture.
kaise internally work karta hai ye samja diya hota to aur behtar hota yaha tak to badiya hi hai aur bahut asanani samaj aa rahi hai aapki ye python series
Very well explained sir. Loved the video. Such a lucid beautiful explanation can only be delivered when someone have great experience and have dealt with various kind of students. Really loved the video. " Nobody Nobody Nobody does it better ".😍😍
ha ye bat to hai jaha sach me kuchh sikh rahe hai us channel ka bahot slow growth ho raha hai but abhi koi hype wali video ban jaye like DSA ya kuchh aisa jo bilkul hype ho aaj kal to waha comments bhi karte hai or subscribe bhi yahi fact hai sir aap content upload kijiye kyu ki mujhe bahot jaruri hai apse padhna or ye bat bakiyo ko bhi lagega jab pata chalega to. ❤❤❤❤💘💘💘💘💘💘❤❤❤❤❤❤
Bhot accha series raha. keep it up bhaiya thoda request h Django ka playlist laao jldi se placement chl rhe h hamare. problem solve krwte krwte accha lg rha hai.
No sir please DSA in python after this, big O notation, stack queue, link list, tree, heap sir important topics only and in-depth like you always teach us..🙏🙏🙏
Sir, Can you please explain why the cache_value = { } & print(cache_value) statements at line no. 4 & 5 are executed only once during the 1st call of the cache decorator and not evertime long_func() is executed and goes through the cache decorator?
I searched many tutorials for learning decorators but none of them are able to understand me the concept of decorators, but finally my search is over and I do not need any further exploration of decorators. Thanks a lot for this wonderful explanations ❤❤❤❤
Agree
Your teaching style is the best for the last banchers also ..this is very helpful..❤
Best explanation of decorators on TH-cam...
Everyone unique..so maintain your own teaching style...
Target is like result do not care
I am age 53 yrs. but student not for exam but for self satisfaction..."योग : कर्म 15:17 सुकौशलम्"
Subjective mindset 👍
Decorators in considered a hard topic, but you have explained it so elegantly that now I can write my own decorator easily.
learning python day 13 - present sir
00:02 Decorators in Python are like tollbooths on a road.
02:00 Decorators are like a decoration item, applied to functions to perform additional work.
06:11 Decorators in Python allow modifying or extending behavior of functions or methods
08:07 Decorators in Python allow you to add functionality to an existing function.
12:11 Decorators in Python allow you to modify the behavior of a function
14:11 Decorators in Python allow you to wrap a function inside another function.
18:03 Decorators in Python act as wrappers for functions.
19:55 Decorators in Python provide a way to modify or extend the behavior of functions or methods at the time of their definition.
23:31 Decorators in Python can be used to perform advanced code operations with ease.
25:16 Using formatted strings to separate key and value in decorators
28:58 Decorators in Python can be used for customization and memory optimization
30:53 Decorators in Python allow efficient modification of functions.
34:21 Using decorators to implement caching for functions in Python
36:16 Decorators in Python are like tollbooths for functions, adding functionality without changing the original function.
Sir i am gonna start gen ai from 14th jun. so i completed this series in 3 days thanks a lot. The new start will be so easy thanks
I personally searched many channels for decorators but mean while i got the best
thank you for you wounderful content
The way you teach is wonderful!!
Thank you soooooo much sir!!🙏🏻🙏🏻
I have never been that confident in Python thank you very much
Thoda Thoda Samjh aaya hai Decorators...😃😃
Thank you sir 🙏🙏
I really enjoy your Python videos on the "Chai Aur Code" channel. Your teaching style is excellent, and your industry-level programming content is incredibly valuable. Please continue making these videos; they're helping us understand real-world frameworks much more easily. We're all here to support your channel's growth and would love to see even more industry-level programming content. Keep up the great work!
this is the best lecture I have ever found on decorators! Amazing analogy and teaching style
I could not express how valuable this teaching material is. I hope you keep on doing this fantastic job in future too
cache_values haven't printed in the second call because the print(cache_values) statement is outside the wrapper function. It gets executed only once when the cache decorator is first applied to the long_running_function. After that, the print statement is not re-executed when you call the decorated function.
To print the cache values during each function call, move print(cache_values) statement inside the wrapper function.
Thanks for explanation but, why this behave like, those python knows this is decorator function and treat it differently.
And if, decorator is function why only func is passed in first function and arguments in inner function.
Best ever video on Decorators. Please keep this work coming.
loved the way you have shared the Decorater definition
I watched many videos before but the calmness you bring to solve the tough problems for us makes it easy to understand. Thank you so much
import time
def timer(func):
def wrapper(*args,**kwargs): #*args=[10] and **kwargs={}
start=time.time()
func(*args,**kwargs) #calculate_time(10) *args and **kwargs means you are unpacking the both
end=time.time()
return end-start #result which is approx
return wrapper
@timer
def calculate_time(n): #calculate_time=timer(calculate_time) return wrapper
time.sleep(n)
a=1+2
return a
calculate_time(5) #wrapper(10)
print(calculate_time(5)) #value returned from return end-start which is 5 //For reference
Just three words- Amazing, Amazing and Amazing
Your teaching style is very calm and thorough
learned decorators and really loved it...
and indeed it was hard but you explained it so easily, thank you Sir.. and if I got stuck somewhere, I will return to revise this topic
Best explanation of decorator ever !!
We don't want only gyaan ki baatein, we want to learn as you said (so we are doing, thanks to your amazing content). Itni clarity to content lenses lga kr nahi aati jitni aapke videos dekh kr aajati hai😂😂
I was worried in 3rd example as how will multiple args will become key for 'cache_value' dictionary.
But it's a tuple which is immutable, so it can be key in dictionary.
Awesome!
Sir I am very serious you are only best teacher in coding ❤
Honestly I like the way you teach the concepts . Specially the question and answers it gives good clarity about the topic and side by side a practical approach is done
Well Explained topic I have learned it from so much videos and articles but this one is outstanding.
Best teacher in TH-cam. Love you sir❤
Wow! Learned an amazing concept in python and that too so easily. Thank You!
Understood the decorators concept, the examples given here are very much useful, Thank you Sir
Really awesome concept and very well explained Hitesh Sir, Thank You🤩
Awesome explanation on decorators.. understood easily thank you sir ❤
very unique and pleasant way of teaching , i am glad that i find your channel in a random search , keep uploading videos sir,❤❤
Perfect Explanation on decorators in python
very unique and pleasant way of teaching , i am glad that i find your channel in a random search , keep uploading videos sir,
Unmatchable , Very well explained advance concepts , Thank you sir 💚💚💚
this one of the best series in pytohn
outstanding churcha about decorators was excellent. I loved it, but I was a bit disappointed that you didn't use the term 'churcha' even once throughout the entire lecture.
full support from us sir, can't wait to learn django after this
kaise internally work karta hai ye samja diya hota to aur behtar hota yaha tak to badiya hi hai aur
bahut asanani samaj aa rahi hai aapki ye python series
I like your course🥰🥰🥰🥰
Very well explained,as usual. Thank you for being there 👍
Tough concept.. finally understood. Thank you
Thank You Sir
For Your heartfelt Efforts
Best explanation of decorators❤
Last example was fantastic ❤
Best teacher in youtube❤
sir mai late se hi class kiya par achhe se samjh aaya thanku
one of the best video on decorator
thankyou sir for making python actual easy
Nice to see your python series .. the most waited one
Very well explained sir. Loved the video. Such a lucid beautiful explanation can only be delivered when someone have great experience and have dealt with various kind of students. Really loved the video. " Nobody Nobody Nobody does it better ".😍😍
done done sir, The best series of python.
Loved the simple explanation!!!!!
Damn that was smooth explaination!! Thanks buddy!
Finally understood decorator thanks
Absolutely perfect video ❤❤
Loved it
Understood the concept of decorators.
best explanation , i finally understood the topic 👍
Your js course is just awesome
Great video on Decorators
best video on decorator
toll booth is best analogy cleared my doubts
This channel make me to finish course
Thank you bhai for this series😘😘
best python series ever!
Seems interesting after viewing starting 1st minute
Sir your teaching is best
ha ye bat to hai jaha sach me kuchh sikh rahe hai us channel ka bahot slow growth ho raha hai but abhi koi hype wali video ban jaye like DSA ya kuchh aisa jo bilkul hype ho aaj kal to waha comments bhi karte hai or subscribe bhi yahi fact hai sir aap content upload kijiye kyu ki mujhe bahot jaruri hai apse padhna or ye bat bakiyo ko bhi lagega jab pata chalega to. ❤❤❤❤💘💘💘💘💘💘❤❤❤❤❤❤
sir never stop your effort it helps us a lot
Amazing problem-solving questions, waiting for django playlist
Awesome explantion sir, Toll Booth
thia is really very amazing knowladge.
you are an amazing teacher!!!
Very unique way visualize the concept thanks 👍
Glad you like it!
One word: Awesome!!!!
so decorators are basically higher order components like in react they can take a function as an argument or returns a functions
i'm learn manythings from this thank u for this video creation
You are the best teacher
❤❤❤❤❤ best teacher with chai ☕ 😂
very simple and beautifull explanition
true gold is never appreciated by everyone
print("Bilkul mza aaya sir")
Good morning sir, A cup of tea ready to bust my energy. ☕☕☕
Thank you very much sir,aj ja k samgh ayaaa theek se
Sir machine learning deep learning series bhi layeeee
Thank you sir for such informative video
Bhot accha series raha.
keep it up bhaiya
thoda request h Django ka playlist laao jldi se placement chl rhe h hamare.
problem solve krwte krwte accha lg rha hai.
Bahut majja aya sir❤❤❤
Highly underrated channel 🥹
maza aa gaya
Thanks ❤
Very well explained!
Excellent! Subscribed ✅
No sir please DSA in python after this, big O notation, stack queue, link list, tree, heap sir important topics only and in-depth like you always teach us..🙏🙏🙏
💛great explanation sir
Sir, please aise hi padhao
you are my guru man
you deserve subscribe brother
Sir,
Can you please explain why the
cache_value = { } & print(cache_value)
statements at line no. 4 & 5 are executed only once during the 1st call of the cache decorator and not evertime long_func() is executed and goes through the cache decorator?