O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Functional Programming with Python

Video Description

In this Functional Programming with Python training course, expert author Chris Armstrong will teach you functional programming techniques for making maintainable, modular, and testable code. This course is designed for users that already have experience with Python.

You will start by learning about functional programming, including first class functions, recursion, and modifying data structures. From there, Chris will teach you about many functional programming libraries available in the Python ecosystem. This video tutorial will then teach you how to implement a text adventure game using these techniques and libraries. You will also learn how to write unit tests for functional code, use imperative libraries in a functional way, and use first-class effects. Finally, you will create a web UI for the game, and learn how to isolate an imperative web framework so that all of the application logic remains purely functional.

Once you have completed this computer based training course, you will have learned how to apply these functional programming techniques to create maintainable, modular, and testable Python code.

Table of Contents

  1. Introduction
    1. Introduction 00:01:49
    2. Libraries And Setting Up Our Environment 00:01:44
    3. About The Author 00:00:37
    4. How To Access Your Working Files 00:01:15
  2. Functional Programming
    1. What Is Functional Programming? 00:04:09
    2. Why Functional Programming? 00:11:12
    3. First-Class Functions 00:01:35
    4. Recursion 00:04:32
    5. Higher-Order Functions 00:07:07
    6. Modifying Data Structures 00:02:31
  3. A Tour Of FP Libraries
    1. Immutable Data Structures: Introduction To Pyrsistent 00:05:22
    2. Immutable Data Structures: How Pyrsistent Works 00:04:34
    3. Toolz: A Functional Standard Library 00:07:34
    4. Hypothesis: Property-Based Testing 00:05:51
    5. Effect: Isolation Of Side Effects 00:06:54
  4. Implementing A Game
    1. Writing A Game: Interactive Fiction 00:01:49
    2. Implementing A Text Adventure 00:04:57
    3. Adding A Challenge To Our Game - Part 1: Props And Inventory 00:06:48
    4. Adding A Challenge To Our Game - Part 2: Lock And Key 00:06:12
  5. Testing
    1. Writing Unit Tests For Our Simulation Code 00:04:52
    2. Stateful Testing With Hypothesis 00:04:19
    3. Testing Our Game With Hypothesis 00:07:12
  6. User Interface
    1. Creating A Text-Based UI 00:05:24
    2. Testing Effects With Mocks 00:05:56
  7. Integrating With An Imperative Third-Party Library
    1. Using An Imperative Library: SQLite 00:03:25
    2. Using An Imperative Library: Storing And Loading Data 00:04:20
    3. Refactoring Imperative Code 00:03:30
    4. Adding Storage To The Game Loop 00:07:45
  8. First-Class Effects
    1. The Desire For First-Class Effects 00:03:31
    2. Making Our Imperative Shell Pure 00:04:31
    3. Performing Effects 00:02:18
    4. Testing Effects 00:06:28
    5. Creating Custom Intents 00:05:30
  9. Web UI
    1. Introduction To Flask 00:05:01
    2. Making Flask Functional 00:06:25
    3. A Functional Web UI For Our Game 00:06:11
  10. Conclusion
    1. Wrapping Up And What To Do Next 00:01:55