This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jneb
Recipients jneb
Date 2013-12-16.08:31:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1387182676.04.0.471976296284.issue19993@psf.upfronthosting.co.za>
In-reply-to
Content
The pool.imap and pool.imap_unordered functions are documented as "a lazy version of Pool.map".
In fact, they aren't: they consume the iterator argument as a whole. This is almost certainly not what the user wants: it uses unnecessary memory and will be slower than expected if the output iterator isn't consumed in full. In fact, there isn't much use at all of imap over map at the moment.
I tried to fixed the code myself, but due to the two-level queueing of the input arguments this is not trivial.
Stackoverflow's Blckknght wrote a simplified solution that gives the idea how it should work.
Since that wasn't posted here, I thought it would be useful to put it here, even if only for documentation purposes.
History
Date User Action Args
2013-12-16 08:31:16jnebsetrecipients: + jneb
2013-12-16 08:31:16jnebsetmessageid: <1387182676.04.0.471976296284.issue19993@psf.upfronthosting.co.za>
2013-12-16 08:31:15jneblinkissue19993 messages
2013-12-16 08:31:15jnebcreate