25. Decorators [Python 3 Programming Tutorials] | Video



In this tutorial, I explain decorators in a very simple way by going over how to measure 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.
Code in this tutorial is available here: https://github.com/codebasics/py/blob/master/Advanced/decorators.py
Website: http://codebasicshub.com/
Facebook: https://www.facebook.com/codebasicshub
Twitter: https://twitter.com/codebasicshub
Patreon: https://www.patreon.com/codebasics
Proudly WWW.PONIREVO.COM

READ ALSO:  Palak Sharma studying at Harsh tutorials 12th Science 2009 - 2011 | Video

Source

7 Comments

  1. Hi thanks a lot for your videos, i am new to this platform(python) ,
    is this 25 sessions of course enough to learn python course completely ?
    please help me with your comments .

  2. Could you explain what is returned within the time_it function? So the "return result" and "return wrapper"? And is the "return result" within the time_it function redundant?

    Again thanks for these clear tutorials! I also really enjoyed your tutorials about multithreading and multiprocessing. Could you make one about events, or event loops. And could you explain what asynchronous programming is (or is this just a term for multithreading/multiprocessing)?

  3. " Can we use decorator inside decorator?" Use cases of it? — This is my interview question.. please share your view sir on this question..

  4. With all due respect,I want to thank you for let me compleating basics of Python.Now I am looking to dig deeper.I am looking forward to get used to of Data Engineering/Analytic,so could you refer me which series of your video is good to start(1,2 or 3 series in row one after one)please.Thank you

Comments are closed.