From de3111d51ad6565a535e9a7321d2c1fa67d554bd Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Mon, 27 Jul 2015 14:01:05 -0400 Subject: [PATCH] BUG: dict.itervalues() doesn't exist in PY3 --- zipline/algorithm.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/zipline/algorithm.py b/zipline/algorithm.py index 34d6c787..ce845de8 100644 --- a/zipline/algorithm.py +++ b/zipline/algorithm.py @@ -26,6 +26,7 @@ from six.moves import filter from six import ( exec_, iteritems, + itervalues, string_types, ) from operator import attrgetter @@ -1297,5 +1298,7 @@ class TradingAlgorithm(object): """ Return a list of all the TradingAlgorithm API methods. """ - return [fn for fn in cls.__dict__.itervalues() - if getattr(fn, 'is_api_method', False)] + return [ + fn for fn in itervalues(vars(cls)) + if getattr(fn, 'is_api_method', False) + ]