Apr-26-2021, 08:08 PM
I am sorry for naive questions, I am new to python.
I am trying to understand how to deal with self when I am trying to understand a function which was written by a third party.
for example:
In addition,
For few time I have already sow people use __init__, what is the meaning of it, why using it?
Sorry for the naive questions
I am trying to understand how to deal with self when I am trying to understand a function which was written by a third party.
for example:
def __init__(self, peak_finder = None, peak_fitter = None, properties = None, **kwds): """ peak_finder - A PeakFinder object. peak_fitter - A PeakFitter object. properties - Which properties to return, e.g. "x", "y", etc. """ super(PeakFinderFitter, self).__init__(**kwds) self.peak_finder = peak_finder self.peak_fitter = peak_fitter self.properties = properties # The properties must include at least 'x' and 'y'. assert ("x" in self.properties), "'x' is a required property." assert ("y" in self.properties), "'y' is a required property."There is awhy to disable self, I guess I can delete all the self words but it seems not the correct way.
In addition,
For few time I have already sow people use __init__, what is the meaning of it, why using it?
Sorry for the naive questions
