Uploaded March 2022 | Updated September 2026, 2 weeks ago
The sixth episode of #PythonLiveLessons, a weekly live stream about Python code and more, hosted by Sebastiaan Mathôt. In this episode, we'll add documentation to our `markdown_code_exec` project. We'll learn about docstrings and numpydoc, and we'll see how we can use our own project to build a readme file that contains documentation directly from the source code!
The sixth episode of #PythonLiveLessons, a weekly live stream about Python code and more, hosted by Sebastiaan Mathôt. In this episode, we'll add documentation to our `markdown_code_exec` project. We'll learn about docstrings and numpydoc, and we'll see how we can use our own project to build a readme file that contains documentation directly from the source code!


![Inheritance [Object-oriented programming in Python, pt. 3]
In this video, the third of a three-part series about object-oriented programming in Python, I show how to extend an existing class through inheritance (or subclassing). This allows you to create new classes that inherit all functionality of existing classes while extending or changing this functionality. (For more Python tutorials, see https://python.cogsci.nl. For the Rapunzel IDE, see https://rapunzel.cogsci.nl/) Inheritance [Object-oriented programming in Python, pt. 3]](https://i.ytimg.com/vi/fqfqqW-LgBY/mqdefault.jpg)




![Python Decorators 3: Turning a function into a class instance
[https://www.buymeacoffee.com/cogsci] In this video, I show how you can use a decorator to replace a function with a callable class instance that also has methods (class functions) and properties.
You can download the Jupyter Notebook for this video from https://osf.io/2npaf/ Python Decorators 3: Turning a function into a class instance](https://i.ytimg.com/vi/jwcxlZvebDM/mqdefault.jpg)

![Using caching and memoization to optimize Python performance
[https://www.buymeacoffee.com/cogsci] In this video I explain the basics of caching and memoization (caching the results of function calls) and demonstrate how you can implement this using the functools.lru_cache decorator. For more Python tutorials, visit https://python.cogsci.nl/ Using caching and memoization to optimize Python performance](https://i.ytimg.com/vi/kt1ZxWFeTxs/mqdefault.jpg)
