I recently came across the pipe library [0] which allows function chaining in a much more straightforward way:
sum(fib() | where(lambda x: x % 2 == 0) | take_while(lambda x: x < 4000000))
I know in Lisp languages you can extend the syntax easily, but I was wondering if there are any needs for that in Python.[0] https://pypi.org/project/pipe/