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 parameters 
to a method. For example:

def my_method(text, _class='', _style='', _id='', _onclick='')

Could easily be rewritten to:

def my_method(text, **kwargs)

Then kwargs is a dictionary with any extra parameters passed:

if '_class' in kwargs:
   output += 'class = "%s"' % kwargs['_class']

Using *args on the other hand would be if you didn't expect named parameters 
to be used, just an unknown number of unnamed paramters. Hope that helps to 
clarify.

Reply via email to