Buy now from Leanpub or Amazon.
Download a free preview.
Python's best kept secret is its built in support for functional programming. Even better, it allows functional programming to be blended seamlessly with procedural and object oriented coding styles. This book explains what functional programming is, how Python supports it, and how you can use it to write clean, efficient and reliable code.
The book covers the basics of functional programming including function objects, immutability, recursion, iterables, comprehensions and generators. It also covers more advanced topics such as closures, memoization, partial functions, currying, functors and monads. No prior knowledge of functional programming is required, just a working knowledge of Python.
- What is functional programming?
- Objects, variables, and functions as objects.
- Immutable objects.
- Transforming and reducing iterables.
- Partial application and currying.
- Functors and monads.
- itertools, functools and other useful libraries.
Buy now from Leanpub, or download a free preview.
2d arrays abstract data type alignment and arc array arrays bezier curve built-in function circle close closure colour comparison operator comprehension context conversion data types design pattern device space dictionary drawing duck typing efficiency encryption enumerate fill filter font font style for loop function function composition function plot functools game development generativepy tutorial generator geometry gif gradient greyscale higher order function html image processing imagesurface immutable object index inner function input installing iter iterator itertools koch curve l system lambda function len line linspace list list comprehension logical operator lru_cache mandelbrot map monad mutability named parameter numeric python numpy object open operator optional parameter or partial application path polygon positional parameter print pure function pycairo radial gradient range recipes rectangle recursion reduce rgb rotation scaling sector segment sequence slice slicing sound spirograph sprite square str stream string stroke subpath symmetric encryption template text text metrics transform translation transparency tuple turtle unpacking user space vectorisation webserver website while loop zip