Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dabeaz-course/practical-python
/ __repr__
Method
__repr__
Solutions/4_10/stock.py:12–13 ·
view source on GitHub ↗
(self)
Source
from the content-addressed store, hash-verified
10
self.price = price
11
12
def
__repr__(self):
13
return
f
'Stock({self.name!r}, {self.shares!r}, {self.price!r})'
14
15
def
cost(self):
16
''
&
#x27;
Callers
nothing calls this directly
Calls
no outgoing calls
Tested by
no test coverage detected