Guide To: Functional Python & Comprehension Constructs
Not Available / Digital Item
Please be aware orders placed now may not arrive in time for Christmas, please check delivery times.
Guide To: Functional Python & Comprehension Constructs
Do you want to take your Python to the next level?
Python is easy to learn. You can learn the basics in a day and be productive with it. But there are more advanced constructs that you will eventually run across if you spend enough time with it. Don't be confused by these. Learn them, embrace them, and improve your code and others.
Functional Programming and Comprehensions
Functional programming is a somewhat hidden aspect of Python. Though it supports many of the functional constructs, the style is not widely adopted.
On the flip side functional programming appears to be making a resurgence, because of the benefits it can provide.
Â
Comprehensions are an alternative Pythonic construct for programming in a similar manner.These are features of Python that are commonly used instead of their functional counterparts. This book covers:
List Comprehensions
Generator Expressions
Set Comprehensions
Dict Comprehensions
Write Python code like the masters
These constructs, while not necessary per se, allow you to be more succinct, re-use code, and think about code in a different way. You will learn:
How the constructs work
When to use them
Real life examples from the standard library
Understand other's code This book covers many of these intermediate constructs that are available in Python. The book covers both Python 2 and 3. Topics include:
Functional programmingÂ
List comprehensions
Generator expressions
Set & dict comprehensionsÂ
Based on popular tutorials and sessionsÂ
I have taught material similar to these constructs at popular tutorials at conferences such as PyCon, OSCON and Strata (and other conferences). This book is based on my experience teaching and using Python for many years. I hope you learn something while in the course of your reading. Maybe it will help you in your next task, code review, or job interview.
Â
Up Your Advanced Python Skills
It is assumed that the reader has some knowledge of Python. You will walk away knowing the functional constructs, when to use them, how to use them, and when to use their Pythonic counterparts. The functional aspects will aid in grokking Python, Lisps, and other newer languages such as Clojure and Scala.