@@ -76,7 +76,7 @@ def worker(inqueue, outqueue, initializer=None, initargs=()):
7676
7777class Pool (object ):
7878 '''
79- Class which supports an async version of the `apply()` builtin
79+ Class which supports an async version of applying functions to arguments.
8080 '''
8181 Process = Process
8282
@@ -135,21 +135,22 @@ def _setup_queues(self):
135135
136136 def apply (self , func , args = (), kwds = {}):
137137 '''
138- Equivalent of `apply()` builtin
138+ Equivalent of `func(*args, **kwds)`.
139139 '''
140140 assert self ._state == RUN
141141 return self .apply_async (func , args , kwds ).get ()
142142
143143 def map (self , func , iterable , chunksize = None ):
144144 '''
145- Equivalent of `map()` builtin
145+ Apply `func` to each element in `iterable`, collecting the results
146+ in a list that is returned.
146147 '''
147148 assert self ._state == RUN
148149 return self .map_async (func , iterable , chunksize ).get ()
149150
150151 def imap (self , func , iterable , chunksize = 1 ):
151152 '''
152- Equivalent of `itertool.imap ()` -- can be MUCH slower than `Pool.map()`
153+ Equivalent of `map ()` -- can be MUCH slower than `Pool.map()`.
153154 '''
154155 assert self ._state == RUN
155156 if chunksize == 1 :
@@ -167,7 +168,7 @@ def imap(self, func, iterable, chunksize=1):
167168
168169 def imap_unordered (self , func , iterable , chunksize = 1 ):
169170 '''
170- Like `imap()` method but ordering of results is arbitrary
171+ Like `imap()` method but ordering of results is arbitrary.
171172 '''
172173 assert self ._state == RUN
173174 if chunksize == 1 :
@@ -185,7 +186,7 @@ def imap_unordered(self, func, iterable, chunksize=1):
185186
186187 def apply_async (self , func , args = (), kwds = {}, callback = None ):
187188 '''
188- Asynchronous equivalent of `apply()` builtin
189+ Asynchronous version of `apply()` method.
189190 '''
190191 assert self ._state == RUN
191192 result = ApplyResult (self ._cache , callback )
@@ -194,7 +195,7 @@ def apply_async(self, func, args=(), kwds={}, callback=None):
194195
195196 def map_async (self , func , iterable , chunksize = None , callback = None ):
196197 '''
197- Asynchronous equivalent of `map()` builtin
198+ Asynchronous version of `map()` method.
198199 '''
199200 assert self ._state == RUN
200201 if not hasattr (iterable , '__len__' ):
0 commit comments