Functional Programming in Python [Video]

Functional Programming in Python [Video]

Sebastiaan Mathôt

1 customer reviews
Use Functional Programming as a powerful tool to solve many real-world problems by writing robust, testable, and bug-free code
Mapt Subscription
FREE
$29.99/m after trial
Video
$106.25
RRP $124.99
Save 14%
What do I get with a Mapt Pro subscription?
  • Unlimited access to all Packt’s 5,000+ eBooks and Videos
  • Early Access content, Progress Tracking, and Assessments
  • 1 Free eBook or Video to download and keep every month after trial
What do I get with an eBook?
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with Print & eBook?
  • Get a paperback copy of the book delivered to you
  • Download this book in EPUB, PDF, MOBI formats
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
What do I get with a Video?
  • Download this Video course in MP4 format
  • DRM FREE - read and interact with your content when you want, where you want, and how you want
  • Access this title in the Mapt reader
$0.00
$106.25
$29.99p/m after trial
RRP $124.99
Subscription
Video
Start 30 Day Trial
Subscribe and access every Packt eBook & Video.
 
  • 5,000+ eBooks & Videos
  • 50+ New titles a month
  • 1 Free eBook/Video to keep every month
Start Free Trial
 
Preview in Mapt

Video Details

ISBN 139781788292450
Course Length2 hours and 34 minutes

Video Description

Functional programming is a style of programming that is characterized by short functions, lack of statements, and little reliance on variables. You will learn what functional programming is, and how you can apply functional programming in Python.

In this video course, we will learn what functional programming is, and how it differs from other programming styles, such as procedural and object-oriented programming. We will also learn why and when functional programming is useful, and why and when it makes programs unnecessarily complex. Then we go on to explore lambda expressions, which are short one-line functions, and are the purest form of functional programming that Python offers. Next, we will learn about higher-order functions: functions that accept other functions as argument, or return other functions as return values. In Python, higher-order functions are elegantly supported through decorators. We will also encounter important concepts from functional programming, such as monads, currying, statelessness, side-effects, memoization, and referential transparency; these concepts may initially seem odd to Python programmers, but we will see how they are elegantly supported by the language. In fact, many Python programmers already make use of concepts from functional programming without being aware of doing so.

All the videos in this course contain hands-on examples of the introduced concepts. We will also consider several different implementations of an interactive calculator to illustrate how you can use functional programming in a simple-but-complete program.

Style and Approach

This is a hands-on course where each video starts by introducing a topic, followed by short, practical examples; some contain more elaborate examples to demonstrate how all the concepts learned so far can be applied in a realistic project.

Table of Contents

Exploring the Pros and Cons of Functional Python with an Example
The Course Overview
Example – A Functional, Interactive Calculator
Pro – Stateless, Referentially Transparent Functions Produce the Same Result
Pro – You Can Prove That Code Is Correct at Least in Theory
Con – Complexity and Overly Deep Recursion
Con – Functional Programming Can Be Unintuitive
Lambda Expressions or Nameless Functions
The Difference Between Statements and Expressions
Diving into Lambda Expressions
Understanding ‘and’ and ‘or’
Diving into Inline ‘if’ Expressions
Higher-order Functions – Functions as Arguments and Return Values
Passing a Function as an Argument to Another Function
Nesting a Function in Another Function
Returning a Function from Another Function
The Operator Module – Operators as Regular Functions
Decorators – The @ Prefix
Decorators with Arguments
Common Functional Design Patterns
Currying – One Argument per Function
Monads – Variables That Decide How They Should Be Treated
Memoization – Remembering Results
Errors and Exceptions in Lambda Expressions
You Cannot Catch Exceptions in Lambda Expressions
Handling Errors in Lambda Expressions
Example – A Fully Functional, Interactive Calculator

What You Will Learn

  • Recognize the value of Functional Programming
  • Understand the advantages and disadvantages of Functional Programming
  • Higher-order functions and Lambda expressions (nameless functions)
  • Error handling in Functional Programming
  • Understand common functional design patterns, and how these apply to Python

Authors

Table of Contents

Exploring the Pros and Cons of Functional Python with an Example
The Course Overview
Example – A Functional, Interactive Calculator
Pro – Stateless, Referentially Transparent Functions Produce the Same Result
Pro – You Can Prove That Code Is Correct at Least in Theory
Con – Complexity and Overly Deep Recursion
Con – Functional Programming Can Be Unintuitive
Lambda Expressions or Nameless Functions
The Difference Between Statements and Expressions
Diving into Lambda Expressions
Understanding ‘and’ and ‘or’
Diving into Inline ‘if’ Expressions
Higher-order Functions – Functions as Arguments and Return Values
Passing a Function as an Argument to Another Function
Nesting a Function in Another Function
Returning a Function from Another Function
The Operator Module – Operators as Regular Functions
Decorators – The @ Prefix
Decorators with Arguments
Common Functional Design Patterns
Currying – One Argument per Function
Monads – Variables That Decide How They Should Be Treated
Memoization – Remembering Results
Errors and Exceptions in Lambda Expressions
You Cannot Catch Exceptions in Lambda Expressions
Handling Errors in Lambda Expressions
Example – A Fully Functional, Interactive Calculator

Video Details

ISBN 139781788292450
Course Length2 hours and 34 minutes
Read More
From 1 reviews

Read More Reviews

Recommended for You

Functional Programming with Streams in Java 9 [Video] Book Cover
Functional Programming with Streams in Java 9 [Video]
$ 124.99
$ 106.25
Functional Programming in C# - Part 3 [Video] Book Cover
Functional Programming in C# - Part 3 [Video]
$ 124.99
$ 106.25
Functional Programming in C# - Part 1 [Video] Book Cover
Functional Programming in C# - Part 1 [Video]
$ 124.99
$ 106.25
Functional Programming in C# - Part 2 [Video] Book Cover
Functional Programming in C# - Part 2 [Video]
$ 124.99
$ 106.25
Building an Application with Functional Haskell [Video] Book Cover
Building an Application with Functional Haskell [Video]
$ 124.99
$ 106.25
Concurrent Programming with Python [Video] Book Cover
Concurrent Programming with Python [Video]
$ 124.99
$ 106.25