mirror of
https://github.com/wassname/catalyst.git
synced 2026-10-28 12:51:29 +08:00
Fixes dictionary-style lookup on Position and Portfolio.
Typo on method name, /__getattr__/__getitem__
This commit is contained in:
1 parent
2352c1e576
commit
88070a0f12
1 file changed
+2
-2
+2
-2
@@ -63,7 +63,7 @@ class Portfolio(object):
|
||||
if initial_values:
|
||||
self.__dict__ = initial_values
|
||||
|
||||
def __getattr__(self, key):
|
||||
def __getitem__(self, key):
|
||||
return self.__dict__[key]
|
||||
|
||||
def __repr__(self):
|
||||
@@ -78,7 +78,7 @@ class Position(object):
|
||||
self.cost_basis = 0.0 # per share
|
||||
self.last_sale_price = 0.0
|
||||
|
||||
def __getattr__(self, key):
|
||||
def __getitem__(self, key):
|
||||
return self.__dict__[key]
|
||||
|
||||
def __repr__(self):
|
||||
|
||||
Reference in new issue
Block a user