object patch
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
import fileparse
|
||||
import stock
|
||||
|
||||
class Portfolio(object):
|
||||
class Portfolio:
|
||||
def __init__(self):
|
||||
self._holdings = []
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
from typedproperty import String, Integer, Float
|
||||
|
||||
class Stock(object):
|
||||
class Stock:
|
||||
'''
|
||||
An instance of a stock holding consisting of name, shares, and price.
|
||||
'''
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# tableformat.py
|
||||
|
||||
class TableFormatter(object):
|
||||
class TableFormatter:
|
||||
def headings(self, headers):
|
||||
'''
|
||||
Emit the table headers
|
||||
|
||||
@@ -20,7 +20,7 @@ Float = lambda name: typedproperty(name, float)
|
||||
|
||||
# Example
|
||||
if __name__ == '__main__':
|
||||
class Stock(object):
|
||||
class Stock:
|
||||
name = typedproperty('name', str)
|
||||
shares = typedproperty('shares', int)
|
||||
price = typedproperty('price', float)
|
||||
|
||||
Reference in New Issue
Block a user