Hi all, I know very little about OOP in Python, I'm working on it but, for the time being, here's my problem: I want to create a method of a class with a default value. The problem is that this default value should be an instance field of that same class. For example:
class Test(): def __init__(self): self.field='Default' def myMethod(self, parameter=self.field): pass I'm getting an error like "name 'self' is not defined"; it seems I cannot access self.field in the method definition. Is there a work-around (or maybe just the proper way to do it)? Thank you very much, Daniele _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor