is possible to get order of keyword parameters ?

rndblnch rndblnch at
Fri Jan 25 21:25:16 CET 2008

On Jan 25, 9:01 pm, Duncan Booth < at invalid.invalid> wrote:
> rndblnch <rndbl... at> wrote:
> > the following example should also
> > work:
> > size = Point(width=23, height=45)
> > w, h = size
> So you want the unpacking to depend on how the Point was initialised!
> Aaargh!

why not?

def f(*args):
    return iter(args)

the order of the parameters do have a semantic,
i can predict the behaviour of:

x, y = f(1, 2)

to bad it's not possible with:

def g(**kwargs):
    return kwargs.itervalues()

x, y = g(x=1, y=2)


More information about the Python-list mailing list