[Chicago] order of keyword arguments

Igor Sylvester igorsyl at gmail.com
Wed Feb 4 19:07:08 CET 2009

Hi Everyone,

Is there a way to obtain the order of keyword arguments in this example:

def foo(**kargs):
            print kargs.items()

The call foo(A=0, B=1) could print (('A', 0), ('B', 1)) or (('B', 1), ('A',

Since dictionaries do not know about ordering, I can't obtain the order of
keyword arguments by simply looking into kargs.
Perhaps there is a way to introspect the function stack to get a hold of the
order of the arguments.  Does anyone know if this is possible?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20090204/4dfd0a9f/attachment.htm>

More information about the Chicago mailing list