rndblnch [EMAIL PROTECTED] wrote:
On Jan 25, 9:01 pm, Duncan Booth [EMAIL PROTECTED] wrote:
rndblnch [EMAIL PROTECTED] 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!
On Jan 25, 9:01 pm, Duncan Booth [EMAIL PROTECTED] wrote:
rndblnch [EMAIL PROTECTED] 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):
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
rndblnch [EMAIL PROTECTED] wrote:
(sorry, draft message gone to fast)
i.e. is it possible to write such a function:
def f(**kwargs):
skipped
return result
such as :
f(x=12, y=24) == ['x', 'y']
f(y=24, x=12) == ['y', 'x']
what i need is to get the order of the keyword
On Fri, 25 Jan 2008 05:49:40 -0800, rndblnch wrote:
def f(**kwargs):
skipped
return result
such as :
f(x=12, y=24) == ['x', 'y']
f(y=24, x=12) == ['y', 'x']
what i need is to get the order of the keyword parameters inside the
function.
any hints ?
Impossible. Dictionaries
Steven Bethard wrote:
rndblnch wrote:
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
i.e. is it possible to write a function
def f(**kwargs):
return
--
http://mail.python.org/mailman/listinfo/python-list
(sorry, draft message gone to fast)
i.e. is it possible to write such a function:
def f(**kwargs):
skipped
return result
such as :
f(x=12, y=24) == ['x', 'y']
f(y=24, x=12) == ['y', 'x']
what i need is to get the order of the keyword parameters inside the
function.
any hints ?
thanks,
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
rndblnch wrote:
(sorry, draft message gone to fast)
i.e. is it possible to write such a function:
def f(**kwargs):
skipped
rndblnch [EMAIL PROTECTED] 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!
--
http://mail.python.org/mailman/listinfo/python-list
rndblnch wrote:
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
11 matches
Mail list logo