Default method arguments

gregory.petrosyan at gregory.petrosyan at
Tue Nov 15 17:03:26 CET 2005

Hello everybody!
I have little problem:

class A:
    def __init__(self, n): = n
    def f(self, x = ????)
        print x

All I want is to make the default argument for self.f(). (I
want to use 'A' class as following :

myA = A(5)

and get printed '5' as a result.)

More information about the Python-list mailing list