Re: variable argument unpacking

2016-12-04 Thread Veek M
Peter Otten wrote: > Mehrzad Irani wrote: > >> Hi All, >> >> Consider the situation >> [cti@iranim-rhel python_cti]$ cat a.py >> def a(a = 1, b = 2, c = 3, *d, **e): >> print(a, b, c) >> print(d) >> print(e) >> >> r = {'e': 7, 'f': 8, 'g': 9} >> >> >> a(**r) >> a(3, **

Re: variable argument unpacking

2016-06-01 Thread Alexandre Paloschi Horta
The way you defined the function: def a(a = 1, b = 2, c = 3, *d, **e): print(a, b, c) print(d) print(e) a, b and c are positional arguments. d will be filled with the excess arguments and e will receive a dictionary, if supplied. One thing is the function definition, ano

Re: variable argument unpacking

2016-05-23 Thread Peter Otten
Mehrzad Irani wrote: > Hi All, > > Consider the situation > [cti@iranim-rhel python_cti]$ cat a.py > def a(a = 1, b = 2, c = 3, *d, **e): > print(a, b, c) > print(d) > print(e) > > r = {'e': 7, 'f': 8, 'g': 9} > > > a(**r) > a(3, **r) > > r1 = (4,5,6) > > a(3,2,1,*r1,

variable argument unpacking

2016-05-23 Thread Mehrzad Irani
Hi All, Consider the situation [cti@iranim-rhel python_cti]$ cat a.py def a(a = 1, b = 2, c = 3, *d, **e): print(a, b, c) print(d) print(e) r = {'e': 7, 'f': 8, 'g': 9} a(**r) a(3, **r) r1 = (4,5,6) a(3,2,1,*r1, **r) a(*r1, **r) r1 = (4,5,6,7) a(*r1, **r) [cti@iranim