Abstract
The modules available as functional programming aids are dealt with here. The built-in functions for algebra and logic operation are defined as convenient functions in the operator module. ‘Itemgetter’, ‘attrgetter’ and ‘methodcaller’ are available as generic methods. ‘inplace’ operators corresponding to all composite algebraic and logic operations are available as corresponding useful functions. Compact iterators formed around common functions are available in ‘itertools’. Their use is illustrated. The yield construct is for transforming a function into a corresponding generator. Going a step further ‘yield from’ chains generators for multiple sequences. Decorator provides an elegant template for nested suites. Their use is illustrated through examples. A number of readymade decorators and functions in the ‘functools’ module have been explained through illustrative examples.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
References
Anton H, Rorres C (2005) Elementary linear algebra. Wiley, New Jeresy
van Rossum G, Drake FL Jr (2014) The Python library reference. Python software foundation
Zwillinger D (ed) (2003) Standard mathematical tables and formulae. Chapman & Hall/CRC, New York
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2016 Springer Nature Singapore Pte Ltd.
About this chapter
Cite this chapter
Padmanabhan, T.R. (2016). Functional Programming Aids. In: Programming with Python. Springer, Singapore. https://doi.org/10.1007/978-981-10-3277-6_12
Download citation
DOI: https://doi.org/10.1007/978-981-10-3277-6_12
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-10-3276-9
Online ISBN: 978-981-10-3277-6
eBook Packages: Computer ScienceComputer Science (R0)