Show More
@@ -26,7 +26,6 b' Authors:' | |||||
26 |
|
26 | |||
27 | from __future__ import division |
|
27 | from __future__ import division | |
28 |
|
28 | |||
29 | import types |
|
|||
30 | from itertools import islice |
|
29 | from itertools import islice | |
31 |
|
30 | |||
32 | from IPython.utils.data import flatten as utils_flatten |
|
31 | from IPython.utils.data import flatten as utils_flatten | |
@@ -100,7 +99,7 b' class Map(object):' | |||||
100 | if isinstance(testObject, m['type']): |
|
99 | if isinstance(testObject, m['type']): | |
101 | return m['module'].concatenate(listOfPartitions) |
|
100 | return m['module'].concatenate(listOfPartitions) | |
102 | # Next try for Python sequence types |
|
101 | # Next try for Python sequence types | |
103 |
if isinstance(testObject, ( |
|
102 | if isinstance(testObject, (list, tuple)): | |
104 | return utils_flatten(listOfPartitions) |
|
103 | return utils_flatten(listOfPartitions) | |
105 | # If we have scalars, just return listOfPartitions |
|
104 | # If we have scalars, just return listOfPartitions | |
106 | return listOfPartitions |
|
105 | return listOfPartitions | |
@@ -122,7 +121,7 b' class RoundRobinMap(Map):' | |||||
122 | #print m |
|
121 | #print m | |
123 | if isinstance(testObject, m['type']): |
|
122 | if isinstance(testObject, m['type']): | |
124 | return self.flatten_array(m['type'], listOfPartitions) |
|
123 | return self.flatten_array(m['type'], listOfPartitions) | |
125 |
if isinstance(testObject, ( |
|
124 | if isinstance(testObject, (list, tuple)): | |
126 | return self.flatten_list(listOfPartitions) |
|
125 | return self.flatten_list(listOfPartitions) | |
127 | return listOfPartitions |
|
126 | return listOfPartitions | |
128 |
|
127 |
General Comments 0
You need to be logged in to leave comments.
Login now