You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Iterating over a Client only works if the engine ids start at 0, resulting in inconsistent behavior:
In [1]: from IPython.parallel import Client
In [2]: c = Client()
In [3]: print c[:]
<DirectView [0, 1, 2, 3]>
In [4]: for ct in c:
...: print ct
...:
<DirectView 0>
<DirectView 1>
<DirectView 2>
<DirectView 3>
In [5]: c = Client()
In [6]: print c[:]
<DirectView [4, 5, 6, 7]>
In [7]: for ct in c:
...: print ct
...:
In [8]:
Whether Client should be an iterator or not, I think it should at least be consistent.
The text was updated successfully, but these errors were encountered:
I didn't intend for Client to be iterable (it's a side effect of defining __getitem__). Might as well make it consistent, since the behavior is already there.
I didn't intend for Client to be iterable, but defining `__getitem__` makes it iterable as long as engine IDs are continuous (not always the case).
This explicitly defines `__iter__` so it behaves consistently.
closes#5519
Iterating over a Client only works if the engine ids start at 0, resulting in inconsistent behavior:
Whether Client should be an iterator or not, I think it should at least be consistent.
The text was updated successfully, but these errors were encountered: