On Jan 25, 5:27 pm, Larry Bates <[EMAIL PROTECTED]> wrote:
> Keyword arguments are normally treaded as "order independent".
> Why do you think you need to find the order?  What problem do
> you wish to solve?
>
> -Larry

On Jan 25, 7:39 pm, Duncan Booth <[EMAIL PROTECTED]> wrote:
> The question remains, what use is there for this?

my goal is to implement a kind of named tuple.
idealy, it should behave like this:
p = Point(x=12, y=13)
print p.x, p.y
but what requires to keep track of the order is the unpacking:
x, y = p
i can't figure out how to produce an iterable that returns the values
in the right order.
relying on a "natural" order of the key names is not possible: x, and
y are alphabetically sorted but the following example should also
work:
size = Point(width=23, height=45)
w, h = size

if you have any suggestion to implement such a thing...
thank you

renaud
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to