mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-03 19:46:38 +08:00
Adds dictionary style access to Portfolio object.
This commit is contained in:
@@ -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