Path: csiph.com!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!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: UNSURE 0.272 X-Spam-Level: ** X-Spam-Evidence: '*H*': 0.60; '*S*': 0.15; 'subject:Python': 0.05; 'subject:2.7': 0.09; 'eval': 0.16; 'subject:requests': 0.16; '\xe9crit': 0.16; 'header:In-Reply-To:1': 0.25; 'header:User- Agent:1': 0.26; 'skip:( 20': 0.28; 'to:addr:python-list': 0.33; 'really': 0.36; 'received:fr': 0.36; 'subject:with': 0.36; 'subject: (': 0.36; 'bad': 0.37; 'subject:: ': 0.38; 'skip:l 20': 0.38; 'instead': 0.39; 'to:addr:python.org': 0.39; 'received:192': 0.39; 'received:192.168': 0.40; 'received:80.12': 0.65; 'received:80.12.242.128': 0.84; 'received:smtp.smtpout.orange.fr': 0.84; 'received:smtpout.orange.fr': 0.84; 'safer': 0.91; 'received:80.12.242': 0.93; 'received:orange.fr': 0.93 Date: Fri, 14 Sep 2012 13:46:38 +0200 From: Xavier Combelle User-Agent: Mozilla/5.0 (X11; Linux i686; rv:15.0) Gecko/20120827 Thunderbird/15.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Batching HTTP requests with httplib (Python 2.7) References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Mailman-Approved-At: Mon, 17 Sep 2012 09:31:28 +0200 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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1347867090 news.xs4all.nl 6855 [2001:888:2000:d::a6]:37419 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:29368 instead of Le 14/09/2012 12:56, Dwight Hutto a écrit : > service_num_list = [num for num in range(0,5)] > for service_num in service_num_list: > eval("web_service_call%i(%i)" % (service_num,service_num)) > > service_num_list = [num for num in range(0,5)] for service_num in service_num_list: locals()["web_service_call%i" % (service_num,)](service_num) would be safer eval is really bad