Functional Python Programming

(Wang) #1

Optimizations and Improvements


Using a functional approach, we can write succinct and expressive programs that
accomplish a great deal of processing. Python isn't a properly functional programming
language. For example, we're required to use some imperative programming
techniques. This limitation forces away from purely functional recursions. We gain
some performance advantage, since we're forced to optimize tail recursions into
explicit loops.


We also saw numerous advantages of adopting Python's hybrid style of functional
programming. In particular, the use of Python's higher order functions and generator
expressions give us a number of ways to write high performance programs that are
often quite clear and simple.

Free download pdf