|
1 | 1 | from __future__ import absolute_import |
2 | | -import collections |
3 | 2 |
|
4 | 3 | from six import string_types |
| 4 | +from six.moves import collections_abc |
5 | 5 |
|
6 | 6 | from ..hubstorage.collectionsrt import Collection as _Collection |
7 | 7 |
|
@@ -82,7 +82,7 @@ def iter(self): |
82 | 82 |
|
83 | 83 | :return: an iterator over collections list where each collection is |
84 | 84 | represented by a dictionary with ('name','type') fields. |
85 | | - :rtype: :class:`collections.Iterable[dict]` |
| 85 | + :rtype: :class:`collections.abc.Iterable[dict]` |
86 | 86 | """ |
87 | 87 | return self._origin.apiget('list') |
88 | 88 |
|
@@ -130,9 +130,9 @@ class Collection(object): |
130 | 130 | >>> for elem in foo_store.iter(count=1)): |
131 | 131 | ... print(elem) |
132 | 132 | [{'_key': '002d050ee3ff6192dcbecc4e4b4457d7', 'value': '1447221694537'}] |
133 | | - |
| 133 | +
|
134 | 134 | - get generator over item keys:: |
135 | | - |
| 135 | +
|
136 | 136 | >>> keys = foo_store.iter(nodata=True, meta=["_key"])) |
137 | 137 | >>> next(keys) |
138 | 138 | {'_key': '002d050ee3ff6192dcbecc4e4b4457d7'} |
@@ -185,7 +185,7 @@ def delete(self, keys): |
185 | 185 | The method returns ``None`` (original method returns an empty generator). |
186 | 186 | """ |
187 | 187 | if (not isinstance(keys, string_types) and |
188 | | - not isinstance(keys, collections.Iterable)): |
| 188 | + not isinstance(keys, collections_abc.Iterable)): |
189 | 189 | raise ValueError("You should provide string key or iterable " |
190 | 190 | "object providing string keys") |
191 | 191 | self._origin.delete(keys) |
@@ -219,7 +219,7 @@ def iter(self, key=None, prefix=None, prefixcount=None, startts=None, |
219 | 219 | :param requests_params: (optional) a dict with optional requests params. |
220 | 220 | :param \*\*params: (optional) additional query params for the request. |
221 | 221 | :return: an iterator over items list. |
222 | | - :rtype: :class:`collections.Iterable[dict]` |
| 222 | + :rtype: :class:`collections.abc.Iterable[dict]` |
223 | 223 | """ |
224 | 224 | update_kwargs(params, key=key, prefix=prefix, prefixcount=prefixcount, |
225 | 225 | startts=startts, endts=endts, |
|
0 commit comments