C#3.0 and lambdas

Max M maxm at mxm.dk
Mon Sep 19 16:08:01 CEST 2005


Steven D'Aprano wrote:
> On Mon, 19 Sep 2005 10:31:48 +0200, Fredrik Lundh wrote:
> 
> How many items should you pass in the tuple? If it takes variable
> arguments, then that works, but if you always expect a fixed number, then
> 
> def func((x, y))
> 
> is more explicit.
> 
> The only problem I have is that once you unroll the tuple like that, it is
> hardly necessary to pass the argument as a tuple. Why not just pass x and
> y as two arguments?
> 
> def func(x, y)


why not just pass the tuple as arguments then?

def func(*(x, y))

or as it would normally look:

def func(*arg)

That should work just as well for those cases.



-- 

hilsen/regards Max M, Denmark

http://www.mxm.dk/
IT's Mad Science



More information about the Python-list mailing list