default argument depending on another argumen?

Marco Herrn herrn at gmx.net
Thu Nov 7 17:46:08 EST 2002


Hi, 

I want to define a function like this:

def foo(self, bar, x= bar.x):
    ....
    pass

Now I have the problem that 'bar' isn't really known when defining this
function.
So how can I achieve this behaviour?

Bye
Marco


-- 
Marco Herrn             herrn at gmx.net
(GnuPG/PGP-signed and crypted mail preferred)
Key ID: 0x94620736




More information about the Python-list mailing list