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

preview_player
Показать описание
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.

The code from this video can be found at:

✅ Support My Channel Through Patreon:

✅ Become a Channel Member:

✅ One-Time Contribution Through PayPal:

✅ Cryptocurrency Donations:
Bitcoin Wallet - 3MPH8oY2EAgbLVy7RBMinwcBntggi7qeG3
Ethereum Wallet - 0x151649418616068fB46C3598083817101d3bCD33
Litecoin Wallet - MPvEBY5fxGkmPQgocfJbxP6EmTo5UUXMot

✅ Corey's Public Amazon Wishlist

✅ Equipment I Use and Books I Recommend:

▶️ You Can Find Me On:

#Python
Рекомендации по теме
Комментарии
Автор

Feels a bit like the first time I saw inception.

lwwells
Автор

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.

rmalshe
Автор

Perfect Explanation + Good Examples + Good tempo + Nice voice . thank you corey

MrVwin
Автор

Wow now I can decorate my decorators while I'm using my decorated functions

saitaro
Автор

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!

monasamir
Автор

You could be the best instructor in the entire world... nice flow!

hitmanLis
Автор

PURE GENIUS. BEST VIDEO ON YOUTUBE ABOUT DECORATORS.

dheerajkumar
Автор

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.

jeff_mci_gaming
Автор

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!!!

snyredbaron
Автор

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.

majed
Автор

This is the best explanation of decorators that's I've come across. Kudos!

chiefmofo
Автор

Your clarity on how to start simple then expand into more complex examples in a logical way is amazing.

badoiuecristian
Автор

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!

randiarisman
Автор

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.

amanmaldar
Автор

"A decorator is just a function that takes another function as an argument, adds some kind of functionality, and then returns another function."

AlexCooper
Автор

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).

caio-jlqw
Автор

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.

Oda
Автор

u r the best example for humanity.. that u r providing such kind of education.. that we cant get after paying somewhere..

muzik
Автор

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!

deserve_it
Автор

Each and every video I watch from you helps me feel a bit more like a programmer and pushes away the good old impostor syndrome... you are simply the best coding teacher on the internet and I am so grateful to have come across your channel while re-training to become a developer. Thank you so much.

raphaelpz