MENU

Fun & Interesting

Python Decorators Tutorial

codebasics 103,516 lượt xem 8 years ago
Video Not Working? Fix It Now

Video without background music: https://youtu.be/IVWZxr0kOyI

In this tutorial, I will explain decorators in a very simple way by going over how to measure the execution time of function using decorators. They serve as a wrapper to original function but does a wonderful job of avoiding code duplication and not cluttering original code with additional logic. The video discusses why there is a need of decorators, what is a decorator, how to create decorators and what is call repper function.

Topics that are covered in this Python Video:
0:00 Explain why decorators needed?
3:52 What is a decorator?
4:18 create decorators
4:26 Call repper function

Code in this tutorial is available here: https://github.com/codebasics/py/blob/master/Advanced/decorators.py

Do you want to learn technology from me? Check https://codebasics.io/ for my affordable video courses.

Next Video:
Python unit testing - pytest parameters: https://www.youtube.com/watch?v=rN0TREj8G7U&list=PLeo1K3hjS3uv5U-Lmlnucd7gqF-3ehIh0&index=39

Website: https://codebasics.io/
Facebook: https://www.facebook.com/codebasicshub
Twitter: https://twitter.com/codebasicshub

Comment