PyMOTW: operator
Originally posted
· 1 min read
Functional programming using iterators occasionally requires you to create small functions for simple expressions. Sometimes these can be expressed as lambda
functions. But for some operations, you don’t need to define your own function at all. The operator module defines functions that correspond to built-in operations for arithmetic, and comparison as well as sequence and dictionary operations.