mirror of
https://github.com/wassname/catalyst.git
synced 2026-10-02 12:10:23 +08:00
Adds dictionary style access to Portfolio object.
This commit is contained in:
1 parent
480ca65f56
commit
2352c1e576
1 file changed
+3
@@ -63,6 +63,9 @@ class Portfolio(object):
|
||||
if initial_values:
|
||||
self.__dict__ = initial_values
|
||||
|
||||
def __getattr__(self, key):
|
||||
return self.__dict__[key]
|
||||
|
||||
def __repr__(self):
|
||||
return "Portfolio({0})".format(self.__dict__)
|
||||
|
||||
|
||||
Reference in new issue
Block a user