Functional Programming Python: Lambdas, Decorators, and Other Magic

https://dev.to/codemouse92/dead-simple-python-lambdas-decorators-and-other-magic-5gbf

Python is multi-paradigm: OO or FP.

Useful Functional Programming Techniques :

  • Closure: local variables
  • Resursion : stop unlimiting looping
  • Lambdas : anonymous function for 1-time throw-away functions
  • Nested Function: function returns a function as result.
  • Decorators : wrap an existing function with additional features without modifying it.
Advertisements