Adds dictionary style access to Position object.

This commit is contained in:
Eddie Hebert
2013-01-27 21:19:59 -05:00
parent b3e8d56c02
commit 480ca65f56
+3
View File
@@ -75,6 +75,9 @@ class Position(object):
self.cost_basis = 0.0 # per share
self.last_sale_price = 0.0
def __getattr__(self, key):
return self.__dict__[key]
def __repr__(self):
return "Position({0})".format(self.__dict__)