From a49bd4af4b1d5902db1c3a6ca83d7deed2fb5bb7 Mon Sep 17 00:00:00 2001 From: Eddie Hebert Date: Wed, 23 Jan 2013 17:17:35 -0500 Subject: [PATCH] Adds a contains method to SIDData to support `in` statement. --- zipline/protocol.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/zipline/protocol.py b/zipline/protocol.py index dc235b98..0f9a0f1b 100644 --- a/zipline/protocol.py +++ b/zipline/protocol.py @@ -102,5 +102,8 @@ class SIDData(object): def __len__(self): return len(self.__dict__) + def __contains__(self, name): + return name in self.__dict__ + def __repr__(self): return "SIDData({0})".format(self.__dict__)