I'm a python newbie and yesterday I had to dive into the source code of graphite-web open source project. But my question is not specifically about graphite.
I found this function:
def __eq__(self, other):
if not isinstance(other, TimeSeries):
return False
if hasattr(self, 'color'):
if not hasattr(other, 'color') or (self.color != other.color):
return False
elif hasattr(other, 'color'):
return False
return ((self.name, self.start, self.end, self.step, self.consolidationFunc, self.valuesPerPoint, self.options, self.xFilesFactor) ==
(other.name, other.start, other.end, other.step, other.consolidationFunc, other.valuesPerPoint, other.options, other.xFilesFactor)) and list.__eq__(self, other)
I understand what this method is supposed to do (I come from the java world, and this is quite familiar). My interrogation is about this sample, at the end :
list.__eq__(self, other)
Why is it here and what is this supposed to do ?
Many thanks :)