Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.069 X-Spam-Evidence: '*H*': 0.86; '*S*': 0.00; 'arguments': 0.09; 'subject:method': 0.09; 'cc:addr:python-list': 0.11; 'def': 0.12; 'b):': 0.16; 'subject:class': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'import': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'suggested': 0.26; 'defined': 0.27; 'header:In- Reply-To:1': 0.27; 'idea': 0.28; 'function': 0.29; 'correct': 0.29; 'subject:list': 0.30; 'message-id:@mail.gmail.com': 0.30; 'code': 0.31; 'too.': 0.31; 'minor': 0.31; 'post.': 0.31; 'though.': 0.31; 'url:python': 0.33; 'maybe': 0.34; 'subject:with': 0.35; "can't": 0.35; 'something': 0.35; 'received:google.com': 0.35; 'method': 0.36; 'thanks': 0.36; 'url:org': 0.36; 'two': 0.37; 'depends': 0.38; 'url:library': 0.38; 'that,': 0.38; 'though,': 0.39; 'august': 0.61; 'more': 0.64; 'to:addr:gmail.com': 0.65; 'details': 0.65; 'partial': 0.84; 'pickled': 0.84; 'subject:Using': 0.84; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc:content-type; bh=3Ypg2bXqHEXcsnqbrwyS2Kn2gjmozXzxE94jZkkOOcs=; b=S2ncf1LaKQCEckNcK+clSgSwNeZK9gCDG56G8dND/QPS0ZuGJwdCUbaC1gjoLCdkEr GosDHGrMmOSVOq2SKaqkJXHGgeTwyMv5WUUB92sW2jzmLlpw6xDNoJFTvFi3M8oql/G5 A00QtshNrdPoJVhcOqu+EfSaTZQ/mWlEMaDOMLdXB0sw2OJc3o1OTTTX8spIPDph2j+p 8eFNRXRMGJY/yD8t6kWlDScz9UB+hGy72k3XSL8rSTk61nSQBTR4U8UphI9wx0H9i8Hz dgtrnDrRXPZVmudyeAhrzj/v0IrMuLmPmHBlmqHDWgjipxoBHCngk66s/SqokS7wlcjd xgiQ== X-Received: by 10.112.33.205 with SMTP id t13mr1169940lbi.22.1375915827271; Wed, 07 Aug 2013 15:50:27 -0700 (PDT) MIME-Version: 1.0 Sender: joshua.landau.ws@gmail.com In-Reply-To: References: <96c575da-7601-4023-aa91-e80664f90333@googlegroups.com> <4cff0d5e-33ab-42cd-b6d4-2b4fe235a274@googlegroups.com> <021dfe24-af83-4307-856e-441cf35cb93a@googlegroups.com> <13807c2e-7f9f-45dd-b36e-4cdc7cde6709@googlegroups.com> From: Joshua Landau Date: Wed, 7 Aug 2013 23:49:47 +0100 X-Google-Sender-Auth: 9B9GnbxODCSPk7DbVwvjwgB6Cy0 Subject: Re: Using Pool map with a method of a class and a list To: Luca Cerone Content-Type: text/plain; charset=UTF-8 Cc: python-list X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 33 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1375915830 news.xs4all.nl 15908 [2001:888:2000:d::a6]:47516 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:52155 On 7 August 2013 23:26, Luca Cerone wrote: > Thanks for the post. > I actually don't know exactly what can and can't be pickles.. I just try it and see what works ;). The general idea is that if it is module-level it can be pickled and if it is defined inside of something else it cannot. It depends though. > not what partialing a function means.. "partial" takes a function and returns it with arguments "filled in": from functools import partial def add(a, b): return a + b add5 = partial(add, 5) print(add5(10)) # Returns 15 == 5 + 10 > Maybe can you link me to some resources? http://docs.python.org/2/library/functools.html#functools.partial > I still can't understand all the details in your code :) Never mind that, though, as Peter Otten's code (with my very minor suggested modifications) if by far the cleanest method of the two and is arguably more correct too.