Тёмный

Python Tutorial: Decorators - Dynamically Alter The Functionality Of Your Functions 

Corey Schafer
Подписаться 1,4 млн
Просмотров 935 тыс.
50% 1

In this Python tutorial, we will be learning about decorators. Decorators are a way to dynamically alter the functionality of your functions. So for example, if you wanted to log information when a function is run, you could use a decorator to add this functionality without modifying the source code of your original function. So let's take a look at how these decorators work and a few ways in which we can use them. Let's get started.
First-Class Functions Video: • Programming Terms: Fir...
Closures Video: • Programming Terms: Clo...
The code from this video can be found at:
github.com/Cor...
✅ Support My Channel Through Patreon:
/ coreyms
✅ Become a Channel Member:
/ @coreyms
✅ One-Time Contribution Through PayPal:
goo.gl/649HFY
✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot
✅ Corey's Public Amazon Wishlist
a.co/inIyro1
✅ Equipment I Use and Books I Recommend:
www.amazon.com...
▶️ You Can Find Me On:
My Website - coreyms.com/
My Second Channel - / coreymschafer
Facebook - / coreymschafer
Twitter - / coreymschafer
Instagram - / coreymschafer
#Python

Опубликовано:

 

1 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 1 тыс.   
@lwwells
@lwwells 6 лет назад
Feels a bit like the first time I saw inception.
@heisenolf13
@heisenolf13 4 года назад
Totally
@arvind31459
@arvind31459 4 года назад
If you go three wrapper levels down then there's no coming back 😄
@celebratinglife6239
@celebratinglife6239 4 года назад
😂
@ritikarashmi300
@ritikarashmi300 4 года назад
the most confusing thing about in inception is keeping track of reality
@TheHamous
@TheHamous 3 года назад
hahaha totally agree
@rmalshe
@rmalshe 8 лет назад
The way you teach programming is really nice! Its very basic, it is paced very well, and it is very logical. In addition you use code snippets that are really concise. Many other videos are either too fast, or too slow, or often simply lack the logic. Often times one can see videos, or written programs but when the teacher doesn't tell why it should be done in a certain way, the inspiration is missing, and then it is very tempting to pick up bad habits that may look simpler, but are inefficient methods. Keep up your good work, and every now and then when I will look for efficiency, I will search for your name :) Now I wish you were a data scientist at Intel where I work.
@coreyms
@coreyms 8 лет назад
Hey thanks! I appreciate that.
@popik45
@popik45 7 лет назад
No doubt- it's the best tutorial for python!! Thanks 🙏
@SuhaibDHD
@SuhaibDHD 7 лет назад
i agree, i've never found tutorial videos more interesting, concise and informative than these. thanks so much!
@bisaktobangachi
@bisaktobangachi 6 лет назад
Don't go to Intel leaving your online students. Please keep up this good work.
@缪宇航
@缪宇航 5 лет назад
Agree,this is the best tutorial video about decorator.Also the best video I've found about python
@AlexCooper0
@AlexCooper0 5 лет назад
"A decorator is just a function that takes another function as an argument, adds some kind of functionality, and then returns another function."
@iamblaineful
@iamblaineful 4 года назад
And then it becomes JavaScript
@orkhanahmadov9963
@orkhanahmadov9963 4 года назад
@@iamblaineful ahahahahahhahaha and we were running from javascript to python
@yogenghodke
@yogenghodke 4 года назад
Wow. Poetic words
@ahmednabielalkanaq3559
@ahmednabielalkanaq3559 4 года назад
In other words... "A decorator adds some decorations to a function, returning a decorated function!"
@basicallypitharous1604
@basicallypitharous1604 4 года назад
So basically, a decorator is a function, it's created by taking a argument which will be a function by assigning a variable to an argument which is a function that when executes displays some kind of functionality, this variable is turn into a function by using closures since it assigned its self and returned it and made it a function with that, it took advantage of closures creating a decorator? I don't fully understand but I'll get there
@MrVwin
@MrVwin 7 лет назад
Perfect Explanation + Good Examples + Good tempo + Nice voice . thank you corey
@omarfsosa
@omarfsosa 5 лет назад
Dude, I seriously hope someone, somewhere, is paying you a lot of money for your knowledge xD
@saitaro
@saitaro 7 лет назад
Wow now I can decorate my decorators while I'm using my decorated functions
@coreyms
@coreyms 7 лет назад
Haha. It's definitely easy to get carried away.
@jeff_mci_gaming6018
@jeff_mci_gaming6018 6 лет назад
lolol thats hilarious
@Lilly24244
@Lilly24244 4 года назад
It's hard transitioning from interior design to python
@jeff_mci_gaming6018
@jeff_mci_gaming6018 6 лет назад
Your hands down the best damn online-teacher i've seen yet...there was one other dude on Udemy , but you've surpassed him...Your videos makes programming twice as fun because you explain things so easily for ppl to understand...I can see how this would result in a person spending hours at the keyboard, generating new ways to implement their code with their newly-learned information ( at least that's what your videos have done for me!! lol)....thanks for your hard work, Corey.
@coreyms
@coreyms 6 лет назад
Thanks! I appreciate that
@aziz5556
@aziz5556 6 лет назад
who is that dude on udemy, I hope you didn't mean jose
@jeff_mci_gaming6018
@jeff_mci_gaming6018 6 лет назад
nope not him...out of respect, i would rather not say this person's name. :)
@akshitaggarwal7878
@akshitaggarwal7878 5 лет назад
@@aziz5556 Tony Alicea of Wired part of javascript. Respect Corey a lot but everyone has right to know handful of good teachers :)
@william3588
@william3588 4 года назад
@@aziz5556 is jose portilla bad?
@veganath
@veganath 7 лет назад
My head hurts, I hope I'm not the only one who had to watch this 3 times....lol. BTW wonderful tutorial thanks
@nxxxxzn
@nxxxxzn 7 лет назад
veganath yeah it takes some effort to WRAP one's head around these things at first :D
@caio-jl6qw
@caio-jl6qw 5 лет назад
The proper way to never forget how decorators work is just keeping in mind what that '@' syntax means: @decorator def function(): ... is equivalent to: function = decorator(function).
@oguzhantopaloglu9442
@oguzhantopaloglu9442 4 года назад
"decorator(function)() " would be more accurate I think...
@oguzhantopaloglu9442
@oguzhantopaloglu9442 3 года назад
@@Sciencedoneright 3 IQ
@Sciencedoneright
@Sciencedoneright 3 года назад
@@oguzhantopaloglu9442 why tho
@Sciencedoneright
@Sciencedoneright 3 года назад
@@oguzhantopaloglu9442 me have 120 IQ
@Sciencedoneright
@Sciencedoneright 3 года назад
@@oguzhantopaloglu9442 me intelecc
@hitmanLis
@hitmanLis 8 лет назад
You could be the best instructor in the entire world... nice flow!
@monasamir5288
@monasamir5288 2 года назад
I have no experience in programming whatsoever so my expectations for understanding the concept of decorators were pretty low. However, to my own surprise, after I finished the video, I managed to write and successfully run an entire decorator with no errors whatsoever. Thank you won't be enough! You have got a real talent in simplifying extremely complicated topics to non technical people such as myself and I'm extremely thankful that I got to witness this talent. God bless!
@rushikesh8132
@rushikesh8132 4 года назад
This Guy is A Fucking Legend And a GOD At Teaching Programming . Absolute Madlad . All the respect . Hope I will Repay Him Someday !
@armanveersinghgill2801
@armanveersinghgill2801 5 лет назад
For those who have just watched the videos on first class functions and closures, video starts at 4:40.
@draco_storm_888
@draco_storm_888 4 года назад
5:30 jej
@dropdimes8509
@dropdimes8509 4 года назад
i love this community. appreciate the heads up.
@thapasujan07
@thapasujan07 25 дней назад
💚
@chiefmofo
@chiefmofo 7 лет назад
This is the best explanation of decorators that's I've come across. Kudos!
@majed316
@majed316 5 лет назад
This is the first contact for me with decorators and surprisingly i have got it completely, that's rarely happen to me specially with such complicated concept, usually I need a week at least and tons of resources to make sense out of it. Your videos invaluable treasure, We couldn't thank you enough no matter how many times we say thank you. You are literally my hero.
@coreyms
@coreyms 5 лет назад
Thanks! Glad you found it helpful
@mpertalulaki4186
@mpertalulaki4186 7 лет назад
your python tutorials are works of art; really concise and educational; thanks
@danailpetrov
@danailpetrov 5 лет назад
I just had to say this. I’ve been doing some programming for about 15y now but this isn’t my ‘bread and butter’ so often I’d stuck on a topic (which in this case was the decorators in python) and believe me, I’ve read quite a lot blogs, articles, etc, and as many others I just ended-up here... I can finally say I do understand it and it all makes perfect sense. Thank you for your time and efforts doing this fantastic job! P.s. I really hope my appreciation somehow hopes you pay the bills too ... lol ;-) (I liked, subscribed, etc :-))
@coreyms
@coreyms 5 лет назад
Thanks! I’m glad the video helped. And yes, liking and subscribing helps very much! Thanks again!
@jayeshvasudeva1133
@jayeshvasudeva1133 4 года назад
when he explained *args and **kwargs, tears fell down my eyes
@ex0stasis72
@ex0stasis72 4 года назад
You taught this better in 30 minutes than my university professor taught this in 2 hours.
@amanmaldar
@amanmaldar 6 лет назад
1:25 The variable 'message' wasn't created inside the inner_function but inner_function does have access to message variable. This is called free variable. Spot on. Thanks for the awesome description.
@vxz90044
@vxz90044 5 лет назад
What an amazing teacher. Making the complex; simple. Thank you good sir.
@PR0MINENCE
@PR0MINENCE 4 года назад
Decorating rappers
@elibaum5489
@elibaum5489 4 года назад
watched this video 4 times. Don't regret it.
@sphiwematone8196
@sphiwematone8196 4 года назад
Nobody has ever really had this impact in my life honestly, you sir are my hero I dont even have enough words to describe how great you are. It's also fascinating and soo godly how someone you have not even met can have this amount of impact in your life. You have done for me what no one else has ever done to my life, I moved from being a complete novice to intermediate and I'm hoping to keep learning from your videos. You are the best💯💫👑
@coreyms
@coreyms 4 года назад
Wow, thanks so much for the kind words. I'm really happy to hear the videos have helped :)
@amardeepbhowmick3614
@amardeepbhowmick3614 5 лет назад
This video is a true GEM! You should really consider making an Udemy course. I will share this with all of my Python enthusiast friends. Thank you Corey!
@narekisaghulyan8959
@narekisaghulyan8959 5 лет назад
Corey, amazing tutorials. every time I see you have a tutorial regarding the topic I'm looking for I already know I'll understand it. You should do this full-time. I'll donate :)
@AriaHarmony
@AriaHarmony 6 лет назад
Crystal clear! I finally get decorators! Thank you very much!! :D
@snyredbaron21
@snyredbaron21 6 лет назад
Corey, you never cease to amaze me! I had seen and read several videos and docs about decorators, but I always ended with doubts and more questions. But I think I finally understand very well all I need to know about decorators. Thanks for your videos!!!
@krishnakanth6106
@krishnakanth6106 5 лет назад
OMG !!!!...You made my day...Best video so far on Decorators...My search ends now :)
@muzik6808
@muzik6808 5 лет назад
u r the best example for humanity.. that u r providing such kind of education.. that we cant get after paying somewhere..
@DigitalDivotGolf
@DigitalDivotGolf 5 лет назад
For me this was very confusing to learn but after watching this video 30 times i finally understand it. I would have for sure been left behind in school.
@cisbeautifulanildhar3292
@cisbeautifulanildhar3292 5 лет назад
I have been sitting at home not much to do. So, I decided to do something useful rather than wasting my time. I chose to learn Python. It is now about four weeks since I have been watching your Python tutorial videos. At this stage, I could call myself a basic level Python programmer. All because of the excellent videos and your stellar teaching method. So, a BIG THANK and may god bless you. I have a question though about this video. Why does it print ? display_info ran with arguments (Tom, 22) display_info ran in: 1.0004289150238037 sec Why not in this order? display_info ran in: 1.0004289150238037 sec display_info ran with arguments (Tom, 22) Shouldn't it first execute @any_time decorator and then the function display_info(). Am I confusing myself? Appreciate your response.
@thsdsyt
@thsdsyt 4 года назад
This videos was awesome! Really simple examples for complex tasks. The only thing that I couldn't grasp properly was the idea the wrap decorator inside the functools module. Maybe a video about this specific decorator should clarify this tool a little more. Thank You!!!
@timurbabadjanov9115
@timurbabadjanov9115 6 лет назад
You explain this shit better than most of the professors in my school! Thank you Corey!
@randiarisman2419
@randiarisman2419 5 лет назад
I don't know why, but I never watch full ads before on any youtube channel, but this is the first time I watch all 2 ads, 1 in 2 minutes because I could not support you by money or else. All of your good videos makes me still able to work in my current dying job with my dream that getting my new job in my bright future. Thank you, Corey!
@techcode_man
@techcode_man 6 лет назад
Corey, You are a hero! Thank you so much for these videos, these are the best Python videos I have seen. Your teaching methodology is second to none. Thank You!!!
@badoiuecristian
@badoiuecristian 4 года назад
Your clarity on how to start simple then expand into more complex examples in a logical way is amazing.
@karthikvenkataram4790
@karthikvenkataram4790 Год назад
This content is a boon for newbies like me to learn better about decorators and wrappers. Thanks a lot Corey Schafer 🙏
@ponnuvel659
@ponnuvel659 5 лет назад
I have suggested your tutorial to all of my friends. you are helping many people keep doing , thanks a lot from india.
@simonchou4597
@simonchou4597 4 года назад
That's really helpful! thank you
@felixlucaciu
@felixlucaciu 6 лет назад
Thank you Corey! Your tutorials are surpassing even the ones offered by Pluralsight!
@daiguel5706
@daiguel5706 4 года назад
you're the best, I like all of your videos
@akash__choudhary
@akash__choudhary 4 года назад
Corey, you are the best, I attended many online courses, some are paid but none of them was as good as you. you teach what id important and the way you explain basics,it is superb.thank you for sharing your knowledge free and guiding many of beginner python students like me.
@phytasea
@phytasea 4 года назад
Thank you so much for your time and effort, I clicked like and subscribe button. at 16:05 you have code in line number 18 return self.original_function(*args, **kwargs) I wonder why it still has "return" since it is not a function, it is class.. for me, it generated error but it seems you are okay?? it seems you already changed in code snip can you put a dialog box on video too if it indeed has to be removed. Thank you again.
@empeaTV
@empeaTV 7 лет назад
Such a champion you are making even me understand something a complex as decorators. Thatßs close to impossible, but for some reason I totally get what you teach.
@ofirsa1
@ofirsa1 6 лет назад
שירי יום הולדת
@scullyy
@scullyy 2 года назад
Why does the wrapper need *args and **kwargs? I would have thought only the return statement would need it.
@Chayo016
@Chayo016 7 лет назад
Awesome video! I have an exam in like an hour and you actually made me understand the contents :D You are a very good teacher. I'll definitely watch more of your videos when I'm less in a hurry :)
@coreyms
@coreyms 7 лет назад
Good luck on your exam!
@bhanuchirutha
@bhanuchirutha 2 года назад
ha ha puka
@mixa1901
@mixa1901 5 лет назад
Come on guys, 199000 views and 3400 likes.. It sucks.. U don't even have to patronate the great author.. just let his videos be more popular .. it's so ez to do
@weiso498
@weiso498 7 лет назад
decorator should be called inceptionator instead....
@sciencecompliance235
@sciencecompliance235 5 лет назад
func-ception
@GrantH2606
@GrantH2606 2 года назад
Reading the comments and seeing that people managed to understand it fairly easily makes me think maybe I'm just not cut out for programming because I really cannot grasp it, particularly why these methods of coding would be used. It just doesn't click for me.
@jamesbrown6591
@jamesbrown6591 5 лет назад
by far the best tutorials for python i've come across
@parhamk75
@parhamk75 4 года назад
This tutorial was the best; It expresses the depth of your comprehension and mastery on this issue!
@jasonclement6305
@jasonclement6305 5 лет назад
These python tutorials are the best on youtube.
@amushakya1433
@amushakya1433 4 года назад
I was really annoyed with myself that I couldn't understand the concepts of decorators after searching a lot of place, and after I watched this video the first time, I got about 75% of the whole idea. There was still some doubts so I rewatched this video and boom now I am not confused at all. You're a savior Corey, thanks a bunch. For extra knowledge about the wraps from functools, i understood it from here: stackoverflow.com/questions/308999/what-does-functools-wraps-do
@kanakanayahamselvendira7690
@kanakanayahamselvendira7690 8 лет назад
Excellent Teaching. I have watched so many people tutorial but your's the best. Is there anyway I can get your scripts in the printable format or download those tutorial files Please? It will be very handy.
@deeeeeds
@deeeeeds 6 лет назад
I doubt you're still looking for this but for anyone who might stumble on this video later, there's a GitHub link in the description.
@frankeknarf
@frankeknarf 2 года назад
Is there ever a time where it would be better in any way to use a class decorator instead of a function? Honestly I'm trying to find any valid reason to use a class instead of a function in ANY case, but after many years I still haven't found any. Using classes just seems to add a lot of unneeded complexity to everything.
@Oda3908
@Oda3908 4 года назад
Corey, you are a true mentor and master of programming. I was just trying to remember what its definition said but couldn't understand how it works for those complex explanations. You make it concise and clear, show it in a logical and straight forward way. I just want to say thank you that for all of your tutorial videos you saved so many self-taught programmers.
@korkunctheterrible4302
@korkunctheterrible4302 2 года назад
So I'm about a third of the way in, and from what I get, decorators are what would be in math if we could call a whole composite function by calling its innermost aegument, which is yet another function and hence callable?
@user-pt4vn5hr2z
@user-pt4vn5hr2z 5 лет назад
Thank you corey, you are the best :)
@shahriardhruvo4333
@shahriardhruvo4333 4 года назад
Thanks sir, I can't thank you enough for giving these awesome explanation as someone like me who is a non-native English viewer can understand for free.
@michael_d2
@michael_d2 7 лет назад
Hi Corey, 1. First of all- very nice! 2. Do you have some repository with a code from the video?
@sejalp
@sejalp 7 лет назад
Yes the code snippets that you used, will be handy thing to have to try out. Very nice tutorials indeed.
@maxguichard4337
@maxguichard4337 7 лет назад
The code used in his videos can be found in the description. This video's code can be found at: github.com/CoreyMSchafer/code_snippets/tree/master/Decorators
@shiwamkarn5215
@shiwamkarn5215 Год назад
11:14 sir what if we just call that original_function instead of returning it in line 7 .plz throw a light on this too.waiting for Ur reply🥺🥺🙏🙏
@jamesfrank3421
@jamesfrank3421 6 лет назад
You have got to be one of the best teachers I have ever come across. You explain complicated concepts extremely well. Thank you for your time and effort
@pkaramol
@pkaramol 8 лет назад
At about 12:15, Is the return statement for the original_function within the wrapper function necessary? Doesn't this stops us from adding functionality AFTER the execution of the original function? e.g. 1. def decorator_funcion(original_function): 2. def wrapper_function(): 3. print("Before Decorator") 4. original_function() 5. print("After Decorator") 6. 7. return wrapper_function If we add a return statement in line 4, line 5 will not be executed, right?
@MrMartinfo
@MrMartinfo 7 лет назад
my wrapper function couldn't wrap head function before. After seeing your video my wrapper get's the head function to work :D :D :D good work mate, keep up
@Max24871
@Max24871 7 лет назад
nobody knows Is this a play on 'could not wrap my head around this' ?
@MrMartinfo
@MrMartinfo 7 лет назад
BMicraft Hehe yep. Sarcasm detected :D
@sunitgautam7547
@sunitgautam7547 6 лет назад
Lol! XD
@ibrahimali-xd3bw
@ibrahimali-xd3bw 3 года назад
Great explanation 12:41 I think only *args should be passed , no need to pass **kwargs Thanks
@abdallahsiyabi4784
@abdallahsiyabi4784 3 года назад
thought so as well
@Sciencedoneright
@Sciencedoneright 3 года назад
What would you do if dictionaries were passed? That's why; to be safe he just kept **kwargs as well
@kelvinquinonez7694
@kelvinquinonez7694 8 лет назад
These tutorials are amazing!!!
@bishnudas3562
@bishnudas3562 3 года назад
class decorater_class(object): why did you passed object here? what does it mean?
@aramhamidi7080
@aramhamidi7080 7 лет назад
Best tutorial!
@coreyms
@coreyms 7 лет назад
+Aram Hamidi Thanks, Aram. I saw a notification of another comment of yours about the logging decorator not being applied to both of your functions. I can't find that comment now, so maybe you've got it working. But if you have any further questions just let me know and I'll do my best to answer. Thanks again.
@aramhamidi7080
@aramhamidi7080 7 лет назад
Hi Cory, thanks for noticing. I deleted that comment because I realized the problem was in my own code. You did a great job explaining this subject that I don't have any questions for now. Thanks again.
@deserve_it
@deserve_it 5 лет назад
This is an another example of the very common witty remark.Thing is not complicated as it looks from a first glance, we only need a proper man who can explain it clearly. You are the man ! Thank you very much!
@ionutth4895
@ionutth4895 3 года назад
I dont understand where would you use this, its pointless to show syntax its better to show use case and then syntax this seems useless without code example solving a real problem.
@ShriKanase
@ShriKanase 7 лет назад
Amazing tutorial but I'm having a little trouble understanding how the @wraps decorator made it output the statements correctly. Could you explain that?
@rab_x6958
@rab_x6958 3 года назад
7:50 that's rocket science! i have done so many projects in python! and I cant complete this video in 3 hours!
@MsSuyash1995
@MsSuyash1995 5 лет назад
This was an excellent tutorial video on decorators. I have watched a lot of videos as well as read a countless number of articles/blogs on the topic... And, yet I haven't seen this kind of fluency... I absolutely love how your structure and organize your videos and then, deliver them with great control on the tempo... At no point, I felt lost or thought to myself, I couldn't understand the concepts being shown on the screen... I consider your channel to be the best Python based channel on RU-vid... While I do admire a lot of other channels, like Dan Bader's and the likes, but somehow your impeccable didactic skills make your channel a must for any Python developer, especially beginners... Please keep doing your excellent work... And, I read your interview (that you gave on RealPython.com) and I really appreciate that you have granted access to everyone... So, young learners (especially students who are not financially capable) who are unable to pay the premium to gain access to high-quality resources on Python.
@ajitesh764
@ajitesh764 5 лет назад
First thing I did is like the video... P.S---- Watched it later That's how good you are....best teacher available. A doubt...do we need return result in my_timer function..i mean even if we dont use return the o/p is same....since we have already included executed display_info()..it will print the contents of display_info() without return..... Correct me if I m wrong:: We need to include a executed decorated function in wrapper function and if wrapper func contains some code including executed decorator func.....then do we still need to return anything from wrapper function
@purechao
@purechao 4 года назад
I do not think we need the "return result" - as we can see in the code, the original function (display_info) does not have a return value, so even if we put "return result" it will just return a None and that is not meaningful.
@HowardCodes
@HowardCodes 4 года назад
I'm sorry I didn't come across your channel sooner. I'm more of a tactile learner, but even I have no trouble following along with your tutorials.
@Protick1994
@Protick1994 4 года назад
You are the best. The way you explained it was flawless. Thank you Sir.
@mahesh_kok
@mahesh_kok 6 лет назад
No one Could ever make decorator understand to anyone this better. I find myself lucky to find you on RU-vid and I admit without any doubt, you are SAVIOUR to all those commenting down below..Thanks a ton
@hat0601
@hat0601 4 года назад
I wish I had known your videos years ago it would have saved half of my python learning time! Thanks so much for making these videos.
@karthik-ex4dm
@karthik-ex4dm 6 лет назад
Sould we explicity say " return original_function()" inside wrapper function and then again return wrapper_function. Cant we just say "original_function()" inside wrapper_function instead of "return original_function()" Because any way wrapper_func is returned
@iagosoriano3734
@iagosoriano3734 5 лет назад
Exactly what I was thinking. Managed to figure out the answer?
@mohammadamini1997
@mohammadamini1997 2 года назад
The materials and the practical points were presented so wonderfully. Thank you so much for your great work.
@frederickchesneau1155
@frederickchesneau1155 4 года назад
Hey Corey, I am going through your videos which are awesome. This one in particular is mind blowing! I was able to understand the concept during the video and you saved me countless hours of coding and reading :). Keep it up!
@10a3asd
@10a3asd 2 года назад
holy shit, this was amazingly helpful. I came here to bone up on decorators to understand how to use them to do cProfiling and logging and possibly using them with Prometheus and you covered probably 95% of what I needed to know for all of that.
@sashabagdasarov9649
@sashabagdasarov9649 4 года назад
i really happy when i search solution for my trouble, and find your video
@suhailahamed4991
@suhailahamed4991 6 лет назад
I just walked through this video regarding decorators, additionally i knew what are Clousers and First Class functions....Really, ur teaching is awesome Sir. Thank you
@harikamacharla7005
@harikamacharla7005 5 лет назад
You are too good at teaching. That's only possible when you have a clear idea of every minute thing happening and the order in which it happens. Hats off! and thanks for taking your time and teaching such complex content in such an easy way.
@cegonaove
@cegonaove 3 года назад
God bless you for your content, buddy. It changes lives.
@MrRijoAlex
@MrRijoAlex 7 лет назад
First off, Amazing Video; really well explained!! I spent the whole day trying to understand what decorators & closures were until I came across your videos. I don't think that this video was particularly long for it's nature of intuition and complexity. Thank you so much, Corey!! *Subbed for life* :D
@arsalanahmad1832
@arsalanahmad1832 4 года назад
awsume video. explained really easy. You are an artist! Best wishes
@yongliang3397
@yongliang3397 5 лет назад
i love all of your videos and appreciate your time and effort!
@stephanewamba9610
@stephanewamba9610 5 лет назад
I'm very impressed by the very high quality of your free tutorials which surely surpass paid Udemy and other sites courses, you help a lot of people like that. I'll suggest that you do a tutorial on Python multithreading given that it's a very popular and important topic nowadays. Again thank you for what you do for us.
@swapnashambhu
@swapnashambhu 5 лет назад
The best python tutorial I have come across, you saved my life. Thank-you Corey
@cnewtonc
@cnewtonc 3 года назад
Very good video: That being said. *There are faster ways to call a function within a function that is pass as a function to return a function* I like the video and love Python; however, after so many years of coding and countless projects. I can say that decorators are rarely used because most programmers would simple used CLASSES / OOP to perform the same task.
@marcop-mb506
@marcop-mb506 4 года назад
Flawless tutorials. Great content. Subscribed!
@anujlahoty8022
@anujlahoty8022 Месяц назад
When complexity meets qualitative pedagogy!!! Loved every second of it Sir Corey
@meghaaggarwal8508
@meghaaggarwal8508 4 года назад
Thanks Corey for this indeed amazing tutorial. You are pretty good at giving us strong basic fundamentals on Python!! Such a crisp explanation of decorators
@sodapopinski9922
@sodapopinski9922 5 лет назад
so for the case with @decorator_func above display(), do you lose the ability to call the display func alone without the decorator
@coreyms
@coreyms 5 лет назад
Yes, but if you want to keep the original function separate then you could simply manually wrap the function like we did at the beginning of the video
@opiyosebastian
@opiyosebastian 5 лет назад
You not good but great! Keep up the good job Professor Corey!
@user-a_fellow_traveler
@user-a_fellow_traveler 3 года назад
thanks a lot, this video really helped me to get the concept of decorators
@jpmol17
@jpmol17 3 года назад
It's impressive how after 5 years your videos are still helpful and relevant, even though it's from early version of python. Great content man, very didactical !