Re: [Tutor] Default parameter in class method

2008-10-07 Thread Daniele
2008/10/7 Kent Johnson <[EMAIL PROTECTED]>: > On Tue, Oct 7, 2008 at 10:08 AM, Daniele <[EMAIL PROTECTED]> wrote: > def myMethod(self, parameter=_marker): > if parameter==_marker: >parameter = self.field Thanks Kent and Alan, I've understood the point and I think I'll use Kent's solution :) _

Re: [Tutor] Default parameter in class method

2008-10-07 Thread Alan Gauld
"Daniele" <[EMAIL PROTECTED]> wrote 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.fiel

Re: [Tutor] Default parameter in class method

2008-10-07 Thread Kent Johnson
On Tue, Oct 7, 2008 at 10:08 AM, Daniele <[EMAIL PROTECTED]> wrote: > 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

[Tutor] Default parameter in class method

2008-10-07 Thread Daniele
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__(