sl33k_ wrote:
> Hi,
>
> I am struggling to grasp this concept about def foo(*args). Also, what
> is def bar(*args, *kwargs)?
>
> Isnt it like self must be the first parameter to the method/function?
> If not what are the exceptions?
>
> Also, can the terms method and function be used interchangeably?
>
> TIA
Try
def foo (*args):
print 'foo args:', repr (args)
foo (1, 2, 3, 4)
def bar (*args, **kwargs):
print 'bar args:', args
print 'bar kwargs:', kwargs
bar (1, 2, 3, 4)
bar (1, 2, 3, baz=6, boz=None)
Mel.
--
http://mail.python.org/mailman/listinfo/python-list