Uploaded May 2018 | Updated September 2026, 3 weeks ago
(For more, visit https://pythontutorials.eu !) In this video, I demonstrate the basics of function decorators in Python. I also demonstrate the @functools.wraps decorator for preserving docstrings of decorated functions.
You can download the Jupyter Notebook for this video from osf.io/szwhk
(For more, visit https://pythontutorials.eu !) In this video, I demonstrate the basics of function decorators in Python. I also demonstrate the @functools.wraps decorator for preserving docstrings of decorated functions.
You can download the Jupyter Notebook for this video from osf.io/szwhk









![Using lists effectively in Python
[https://www.buymeacoffee.com/cogsci] Check out the entire playlist with Python lectures! https://www.youtube.com/playlist?list=PLR-r0edywujd8D-R2Kue1C_wYEK_4Ii71
In this video I show several convenient ways to use lists more effectively when programming in Python 3 or Python 2. Using lists effectively in Python](https://i.ytimg.com/vi/S55yOHvUyGk/mqdefault.jpg)
![7 More Tricks to Write Better Python Code
[https://www.buymeacoffee.com/cogsci] This video is a follow-up to 7 Simple Tricks to Write Better Python Code. It again shows seven simple techniques for writing better and easier-to-read Python code.
- 00:30 Inline if-else statements
- 03:00 Sequence comparisons
- 10:00 Extended unpacking (Python-3 only)
- 13:57 Dict comprehensions
- 18:25 collections.OrderedDict
- 21:30 collections.defaultdict
- 26:17 collections.Counter 7 More Tricks to Write Better Python Code](https://i.ytimg.com/vi/SNTZpy0oDB8/mqdefault.jpg)