merits of Lisp vs Python

Christophe chris.cavalaria at free.fr
Thu Dec 14 11:37:23 EST 2006


Robert Uhl a écrit :
> Ken Tilton <kentilton at gmail.com> 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")



More information about the Python-list mailing list