mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-17 11:25:55 +08:00
Fixes dictionary-style lookup on Position and Portfolio.
Typo on method name, /__getattr__/__getitem__
This commit is contained in:
+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