Uploaded January 2021 | Updated September 2026, 2 weeks ago
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/)
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/)




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

![Writing csv, tsv, xlsx files in Python
[https://www.buymeacoffee.com/cogsci] This is the first video of a two-part series on working with spreadsheet-like data in Python. Here I show how to write DataMatrix and pandas DataFrame objects to csv, tsv, and xlsx files. For more Python tutorials, visit https://python.cogsci.nl/ Writing csv, tsv, xlsx files in Python](https://i.ytimg.com/vi/lRerVytOQLU/mqdefault.jpg)
![Online psychology experiments with OSWeb and JATOS (#2): Distributing links
[https://www.buymeacoffee.com/cogsci] This is the second in a short series of videos on creating online psychology experiments with OSWeb/ OpenSesame and JATOS. In this video I show how to import your OpenSesame experiment into JATOS, and how to generate links that you can distribute to participants. Online psychology experiments with OSWeb and JATOS (#2): Distributing links](https://i.ytimg.com/vi/m1UDk5kBwH4/mqdefault.jpg)
![Publishing a Python package on pip [PythonLiveLessons #6]
Episode 6 of #PythonLiveLessons, a weekly live stream about Python code and more, hosted by Sebastiaan Mathôt. In this episode, well learn how to use pyproject.toml to add information about our package, and how to use flit to build our package and upload it to pypi so that users can easily install it with `pip install markdown_code_exec`. Publishing a Python package on pip [PythonLiveLessons #6]](https://i.ytimg.com/vi/mu7yct6hOSA/mqdefault.jpg)