is possible to get order of keyword parameters ?

rndblnch rndblnch at gmail.com
Fri Jan 25 21:25:16 CET 2008


On Jan 25, 9:01 pm, Duncan Booth <duncan.bo... at invalid.invalid> wrote:
> rndblnch <rndbl... at gmail.com> 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?
in

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)

renaud



More information about the Python-list mailing list