[Python-Dev] yeah! for Jeremy and Greg
Ka-Ping Yee
ping@lfw.org
Tue, 28 Mar 2000 18:35:54 -0600 (CST)
On Tue, 28 Mar 2000, Jeremy Hylton wrote:
>
> It's too bad the Makefile doesn't have all the dependencies. It seems
> that it's necessary to do a make clean before checking in a change
> that affects many files.
I updated again and rebuilt.
>>> def sum(*args):
... s = 0
... for x in args: s = s + x
... return s
...
>>> sum(2,3,4)
9
>>> sum(*[2,3,4])
9
>>> x = (2,3,4)
>>> sum(*x)
9
>>> def func(a, b, c):
... print a, b, c
...
>>> func(**{'a':2, 'b':1, 'c':6})
2 1 6
>>> func(**{'c':8, 'a':1, 'b':9})
1 9 8
>>>
*cool*.
So does this completely obviate the need for "apply", then?
apply(x, y, z) <==> x(*y, **z)
-- ?!ng