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

Method __init__

Solutions/7_11/stock.py:13–16  ·  view source on GitHub ↗
(self,name, shares, price)

Source from the content-addressed store, hash-verified

11 price = Float('price')
12
13 def __init__(self,name, shares, price):
14 self.name = name
15 self.shares = shares
16 self.price = price
17
18 def __repr__(self):
19 return f'Stock({self.name!r}, {self.shares!r}, {self.price!r})'

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected