From: Michael Neumann Date: 2003-11-18T23:19:42+09:00 Subject: Re: Again, Rite explanation needed (keyword args and new hash syntax) On Tue, Nov 18, 2003 at 10:32:16PM +0900, gabriele renzi wrote: > il Tue, 18 Nov 2003 21:05:59 +0900, Michael Neumann > ha scritto:: > [...] > >But b:10 is a keyword argument, whereas b=10 would be a numbered > >argument (as in Python). > > well, I thinmk the two are unified in python (I may be wrong): > >>> def f(a=1,b=10): > .... print a > .... print b > .... > >>> f(1) > 1 > 10 > >>> f(1,4) > 1 > 4 > >>> f(a=3,b=434) > 3 > 434 Ah, thanks. But think about this one in Python: def f(a, b=10, *args, **keys): print a, b, args, keys f(1, b=2, c=4, d=8) # all right here # want to use b as keyword argument f(1, "a", "b", "c", b=2, c=4) # => ERROR The problem arises, as it's undecidable if b is a keyword argument or not, so that *args cannot be used in this case (or I am missing something here). > I'm sure it's cool that's why I'm trying to understand it :) Me, too :-) Regards, Michael