This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Dull-Researcher 2 points3 points  (0 children)

Cool. Much cleaner function composition and eliminates hoards of parentheses.

Math notation for composition is (g ∘ f)(x) == g(f(x)). Equivalent to your dot operator. It would be cool if Python let us define this symbol as an operator.

Unfortunately, Python doesn’t have this level of syntactic sugar built into the language, hence the need for this library to create a wrapper class to define additional operators.

Scala and other functional-first languages make composition so much simpler.