Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/dabeaz/python-cookbook
/ Stock
Class
Stock
src/8/simplified_initialization_of_data_structures/example2.py:21–22 ·
view source on GitHub ↗
Source
from the content-addressed store, hash-verified
19
# Example use
20
if
__name__ ==
'__main__'
:
21
class
Stock(Structure):
22
_fields = [
'name'
,
'shares'
,
'price'
]
23
24
s1 = Stock(
'ACME'
, 50, 91.1)
25
s2 = Stock(
'ACME'
, 50, price=91.1)
Callers
1
example2.py
File · 0.70
Calls
no outgoing calls
Tested by
no test coverage detected