Order of keyword arguments

Jeff jam at quark.emich.edu
Sun Nov 21 03:42:45 EST 1999


On Sun, Nov 21, 1999 at 01:33:23AM -0500, Andres Corrada wrote:
> Hi,
> 	Can one access the order in which keyword arguments were passed to a
> function? I want to call a function with the keyword syntax: f(
> foo='theFooString', bar='theBarString' ) and use the fact that foo was
> listed first so I can do something like:
> 
> def f( **kw ):
> 
> 	Process keyword arguments remembering the order in which the were used
> to call the function.
> 	Print first keyword
> 	Print second keyword
> 	.
> 	.
> 	.
> 

keyword arguments are passed as a dictionary, and thus the 'order' of the
arguments will not be preserved. what is the advantage you see to being able
to obtain that information? wouldn't a redesign of the interface keep things
simpler and increase the likelihood of success?

hope that helps.

regards,
J
-- 
|| visit gfd <http://quark.emich.edu/>
|| psa member #293 <http://www.python.org/> 
|| New Image Systems & Services, Inc. <http://www.newimage.com/>




More information about the Python-list mailing list