En Wed, 02 May 2007 04:03:56 -0300, <[EMAIL PROTECTED]> escribió: > On May 1, 11:10 pm, "Gabriel Genellina" <[EMAIL PROTECTED]> > wrote:
>> The right usage is os.path.join(*pathparts) > > Wow. What exactly is that * operator doing? Is it only used in > passing args to functions? Does it just expand the list into > individual string arguments for exactly this situation? Or does it > have other uses? When calling a function, it is used to pass a sequence as positional arguments. Similarly, **values is used to pass a dictionary as keyword arguments. When defining a function, *args receives the remaining positional arguments not already bound to another parameter; and **kwargs receives the remaining keyword arguments not already bound to another parameter. [There is nothing special on the *args and **kwargs names, only the * and ** are important] See section 4.7 on the Python Tutorial http://docs.python.org/tut/node6.html#SECTION006700000000000000000 and specially section 4.7.4 Unpacking Argument Lists. For a more technical description (but sometimes necesary) read the Python Reference Manual http://docs.python.org/ref/calls.html -- Gabriel Genellina -- http://mail.python.org/mailman/listinfo/python-list