MCPcopy Create free account
hub / github.com/dabeaz/python-cookbook / Stock

Class Stock

src/9/capturing_class_attribute_definition_order/example1.py:47–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45
46# Example use
47class Stock(Structure):
48 name = String()
49 shares = Integer()
50 price = Float()
51 def __init__(self, name, shares, price):
52 self.name = name
53 self.shares = shares
54 self.price = price
55
56if __name__ == '__main__':
57 s = Stock('GOOG',100,490.1)

Callers 1

example1.pyFile · 0.70

Calls 3

StringClass · 0.70
IntegerClass · 0.70
FloatClass · 0.70

Tested by

no test coverage detected