Re: question about function pointer

2012-02-17 Thread 88888 Dihedral
在 2012年2月17日星期五UTC+8下午5时55分11秒,Nobody写道: > On Fri, 17 Feb 2012 16:53:00 +0900, Zheng Li wrote: > > > def method1(a = None): > > print a > > > > i can call it by > > method1(*(), **{'a' : 1}) > > > > I am just curious why it works and how it works? > > and what do *() and **{'a' : 1} mean? >

Re: question about function pointer

2012-02-17 Thread Nobody
On Fri, 17 Feb 2012 16:53:00 +0900, Zheng Li wrote: > def method1(a = None): > print a > > i can call it by > method1(*(), **{'a' : 1}) > > I am just curious why it works and how it works? > and what do *() and **{'a' : 1} mean? In a function call, an argument consisting of * followed by

Re: question about function pointer

2012-02-17 Thread Arnaud Delobelle
On 17 February 2012 07:53, Zheng Li wrote: > def method1(a = None): >        print a > > i can call it by > method1(*(), **{'a' : 1}) > > I am just curious why it works and how it works? > and what do *() and **{'a' : 1} mean? > > when I type *() in python shell, error below happens > >  File "",

question about function pointer

2012-02-16 Thread Zheng Li
def method1(a = None): print a i can call it by method1(*(), **{'a' : 1}) I am just curious why it works and how it works? and what do *() and **{'a' : 1} mean? when I type *() in python shell, error below happens File "", line 1 *() ^ SyntaxError: invalid syntax -- http://m