We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents cf2abf1 + ec1ca28 commit 89786f1Copy full SHA for 89786f1
zipline/protocol.py
@@ -97,14 +97,15 @@ def _deprecated_getitem_method(name, attrs):
97
The ``__getitem__`` method to put in the class dict.
98
"""
99
attrs = frozenset(attrs)
100
- msg = "'{0}[attr]' is deprecated, please use '{0}.attr' instead".format(
101
- name,
+ msg = (
+ "'{name}[{attr!r}]' is deprecated, please use"
102
+ " '{name}.{attr}' instead"
103
)
104
105
def __getitem__(self, key):
106
"""``__getitem__`` is deprecated, please use attribute access instead.
107
- warn(msg, DeprecationWarning, stacklevel=1)
108
+ warn(msg.format(name=name, attr=key), DeprecationWarning, stacklevel=2)
109
if key in attrs:
110
return self.__dict__[key]
111
raise KeyError(key)
0 commit comments