A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/075232.html below:

operator on functions

operator on functions operator on functionsSzalay Zoltan szz at philoslabs.com
Fri Apr 6 11:33:13 EDT 2001
Hi everybody out there!

It would be a nice feature of Python syntax providing an operator to 
compose a function from another two:
h=f*g  . I mean (f*g)(x)=f(g(x).

It would be useful e.g. in the following situation:
dict={ key1 : func1, key2 : f * g, key3 : func3 }

I know the following gives the same result:
dict={ key1 : func1, key2 : lambda x: f(g(x)), key3 : func3 }

But the former one is more elegant. (IMHO)

Zoltan Szalay
szz at philoslabs.com



More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4