Assignment itself does nothing. rc here is your client. Executing rc[0] or any indexing generates and returns a DirectView object, which has the form with any engines specified in []. This is a shorthand for creating views: in fact, it is not just getting a specific object.
Thus, these views are not unique. The best way to explain this, I think, with an example. Say you have 2 engines. You want to run some tasks with only one engine and you want the tasks to be blocked. You want to run others on only one engine, but donβt want them to block. You want to run even more on engines 1 and 2 and do not want them to lock. Then you can do:
view_1_block = rc[0] view_1_block.block = True view_2_noblock = rc[0] view_2_noblock.block = False view_3_noblock = rc[[0,1]] view_3_noblock.block = False
Then you can use them to start tasks in any way, for example
view_1_block.map(lambda x:x**10, range(32)) # blocks, returns results, runs only on 1 view_3_noblock.map(lambda x:x**10, range(32)) # does not block, returns AsyncResult, runs on 1 and 2
There is no real magic. When you run rc [0] twice, it generates two views. The second view does not coincide with the first. When you assign rc [0] to a variable and then use this variable, you are working with one view, not creating a new one.
iPython, like Numpy and Scipy, has quite a few abbreviations that are not necessarily suitable for Python idioms. This is especially true for [] and getitem. Using a much more cumbersome rc.direct_view(1) , etc., could become a cleaner way of writing Python, so that it would be clear that this was not just an element, but the actual creation of the view.