From 88070a0f120678c355637d2cf0aee75a4985f2f2 Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Sun, 27 Jan 2013 22:49:20 -0500 Subject: [PATCH] Fixes dictionary-style lookup on Position and Portfolio. Typo on method name, /__getattr__/__getitem__ --- zipline/protocol.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zipline/protocol.py b/zipline/protocol.py index f4b57e74..be4d73a3 100644 --- a/zipline/protocol.py +++ b/zipline/protocol.py @@ -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):