Robert Uhl a écrit :
> Ken Tilton <[EMAIL PROTECTED]> writes:
>> meanwhile, I have not seen how Python lets you avoid revisiting dozens
>> of instances when changes to a mechanism are required.
> 
> I think his solution would have been to use:
> 
>   def foo(**args):
> 
> everywhere, and call it like this
> 
>   foo(bar=baz)
> 
> Of course that makes calls pretty verbose, but it would prevent having
> to visit every function/method every time the signature changes.  As
> long they'd all been set up initially to use keyword args like that.
> And of course one would lose some of the compile-time benefits of
> compiler signature checking.
> 
> It's not optimal, but I think it'd get the job done.
> 

More along the lines of :

def foo(*args, **kwds):
     pass_params(*args, **kwds)

def pass_params(hi, there):
     print "hi :", hi
     print "there :", there

foo("first", there="second")
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to