
Bioinformatics with Python Cookbook
By :

Python has three built-in modules that greatly help when writing code in a functional dialect: functools
, operator
, and itertools
. In this recipe, we are going to briefly discuss the functools
module. For example, the fundamental reduce
function (where part of the name of MapReduce comes from) is only available if you import functools
.
While a detailed exploration of these modules would be too long for a single recipe, we are going to showcase some functionality by improving some of the code of the previous recipes with the functionality from functools
and showcase some illustrative examples of the utility of the module.
Our code is available in Chapter12/Builtin.py
. We will make references to previous recipes.
Let’s look at several illustrative examples: