Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dabeaz-course/practical-python
/ __contains__
Method
__contains__
Solutions/6_7/portfolio.py:16–17 ·
view source on GitHub ↗
(self, name)
Source
from the content-addressed store, hash-verified
14
return
self._holdings[index]
15
16
def
__contains__(self, name):
17
return
any([s.name == name
for
s in self._holdings])
18
19
@property
20
def
total_cost(self):
Callers
nothing calls this directly
Calls
no outgoing calls
Tested by
no test coverage detected