mirror of
https://github.com/wassname/catalyst.git
synced 2026-09-11 12:00:50 +08:00
MAINT: Use Python 3 compatible metaclass.
Use six's with_metaclass to have objects that use metaclasses, in both Python 2 and 3. Otherwise, in Python 3 the objects were being treated as if they did not have a metaclass, when the Python 2 syntax is used, leading to errors because of missing attributes, etc.
This commit is contained in:
@@ -17,13 +17,14 @@ from zipline.errors import WrongDataForTransform
|
||||
from zipline.transforms.utils import TransformMeta
|
||||
from collections import defaultdict, deque
|
||||
|
||||
from six import with_metaclass
|
||||
|
||||
class Returns(object):
|
||||
|
||||
class Returns(with_metaclass(TransformMeta)):
|
||||
"""
|
||||
Class that maintains a dictionary from sids to the sid's
|
||||
closing price N trading days ago.
|
||||
"""
|
||||
__metaclass__ = TransformMeta
|
||||
|
||||
def __init__(self, window_length):
|
||||
self.window_length = window_length
|
||||
|
||||
Reference in New Issue
Block a user