mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-15 11:22:18 +08:00
Adds dictionary style access to Position object.
This commit is contained in:
@@ -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__)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user