Default method arguments

Gregory Petrosyan gregory.petrosyan at gmail.com
Tue Nov 15 11:24:49 EST 2005


Thanks a lot, but that's not what I do really want.
1) f() may have many arguments, not one
2) I don't whant only to _print_ x. I want to do many work with it, so
if I could simply write

def f(self, x = self.data)                           (*)

it would be much better.

By the way, using

class A(object):
    data = 0
    ....
    def f(self, x = data)

solves this problem, but not nice at all

So I think (*) is the best variant, but it doesn't work :(




More information about the Python-list mailing list