Classes and keywords
Michael.Husmann at t-online.de
Mon Sep 18 20:51:34 CEST 2000
The following code is refused by python and I wonder why:
self.k = 0
def set(self, w=self.k):
return w * w
k = Foo()
if __name__ == "__main__": main()
Traceback (most recent call last):
File "<stdin>", line 11, in ?
File "<stdin>", line 15, in Foo
NameError: There is no variable named 'self'
Is there someone who can help me using such a keyword argument like I
have done in that 'set' function.
More information about the Python-list