A RetroSearch Logo

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

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2006-February/060440.html below:

[Python-Dev] any support for a methodcaller HOF?

[Python-Dev] any support for a methodcaller HOF?Bengt Richter bokr at oz.net
Mon Feb 6 00:28:55 CET 2006
On Sun, 05 Feb 2006 18:45:52 GMT, bokr at oz.net (Bengt Richter) wrote:
[...]
>Psst, Nick, how about
>    (x*y for x,y in ()) ? # "()" as mnemonic for call args
D'oh, sorry, that should have been illegal syntax, e.g.,

     (x*y for x,y in *) ? # "*" as mnemonic for call *args
so
     (x*y for x,y in *)(3,5) # => 15
or
     (x*y for x,y in *)(*[3,5]) # => 15
etc.

Hm, along that line why not

     (x*y for x,y in **) ? # "**" as mnemonic for call **kwargs
so
     (x*y for x,y in **)(x=3, y=5) # => 15
or maybe even
     (x*y+z for (x,y),z in *,**)(3, 5, z=200) # => 215

Though I see this is moot, since Guido decided to "keep lambda,"
(+1 on that, although this is kind of growing on me, no doubt from
partial ih-factor ;-)

Regards,
Bengt Richter

More information about the Python-Dev 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