MCPcopy Create free account
hub / github.com/dabeaz-course/practical-python / __contains__

Method __contains__

Solutions/8_2/portfolio.py:35–36  ·  view source on GitHub ↗
(self, name)

Source from the content-addressed store, hash-verified

33 return self._holdings[index]
34
35 def __contains__(self, name):
36 return any(s.name == name for s in self._holdings)
37
38 @property
39 def total_cost(self):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected