I am attempting to use an instance attribute as a default parameter. Unfortunately, python doesn't seem to recognize the "self" variable
class Example(object):
def __init__(self, name):
self.bar = ""
def foo(self, param=self.bar):
print self.bar
Why doesn't python allow the use of self in the method signature? Also, any tips on a smooth way to achieve a similar result without the use of self?