Re: [web2py] Re: vars vs. kwargs

2011-06-09 Thread Ross Peoples
web2py makes extensive use of these. Take the A, DIV, or TABLE as examples, you can pass HTML attributes (e.g. _class, _id, _style) to these, but if you look at the code, you will notice that these things are not in the signature of these methods. They allow you to provide an unknown number of p

Re: [web2py] Re: vars vs. kwargs

2011-06-09 Thread Stifan Kristi
pardon me, what is the meaning of *args and **vars? thank you.

[web2py] Re: vars vs. kwargs

2011-06-09 Thread Massimo Di Pierro
fixed in trunk. Thanks On Jun 9, 9:24 am, Pawel Jasinski wrote: > hi, > sorry for being to cryptic. > > In [1]: def foo(*args,**kwargs): >    ...:     print vars >    ...: >    ...: > > In [2]: foo() > > > In [3]: def bar(*args,**vars): >    ...:     print vars >    ...: >    ...: > > In [4]: b

[web2py] Re: vars vs. kwargs

2011-06-09 Thread Massimo Di Pierro
Now I understand. It is a problem witg the example. Will fix it. On Jun 9, 9:24 am, Pawel Jasinski wrote: > hi, > sorry for being to cryptic. > > In [1]: def foo(*args,**kwargs): >    ...:     print vars >    ...: >    ...: > > In [2]: foo() > > > In [3]: def bar(*args,**vars): >    ...:     pri

Re: [web2py] Re: vars vs. kwargs

2011-06-09 Thread Pawel Jasinski
hi, sorry for being to cryptic. In [1]: def foo(*args,**kwargs): ...: print vars ...: ...: In [2]: foo() In [3]: def bar(*args,**vars): ...: print vars ...: ...: In [4]: bar() {} ref: http://docs.python.org/library/functions.html#vars as I said, it is cosmetic. I bel

[web2py] Re: vars vs. kwargs

2011-06-09 Thread Massimo Di Pierro
I do not understand. :-( On Jun 9, 3:21 am, Pawel Jasinski wrote: > hi, > it is cosmetic, but can be a pain for someone no so familiar with > python. > In examples for restful api: > > def index(): >     def GET(*args,**vars): >         patterns = [ >             "/persons[person]", >