MCPcopy Create free account
hub / github.com/dabeaz-course/python-mastery / __eq__

Method __eq__

Solutions/5_3/stock.py:15–17  ·  view source on GitHub ↗
(self, other)

Source from the content-addressed store, hash-verified

13 return f'{type(self).__name__}({self.name!r}, {self.shares!r}, {self.price!r})'
14
15 def __eq__(self, other):
16 return isinstance(other, Stock) and ((self.name, self.shares, self.price) ==
17 (other.name, other.shares, other.price))
18
19 @classmethod
20 def from_row(cls, row):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected