Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3a.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.004 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'parameters': 0.04; 'mrab': 0.05; 'subject:string': 0.09; '-tkc': 0.16; 'commas:': 0.16; 'from:addr:python.list': 0.16; 'from:addr:tim.thechases.com': 0.16; 'from:name:tim chase': 0.16; 'there?': 0.16; 'subject:python': 0.16; 'wrote:': 0.18; 'putting': 0.22; 'header :In-Reply-To:1': 0.27; 'charset:us-ascii': 0.36; 'list': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'how': 0.40; 'received:50.22': 0.84 Date: Wed, 27 Aug 2014 17:44:46 -0500 From: Tim Chase To: python-list@python.org Subject: Re: python string, best way to concat In-Reply-To: <53FE5EDD.9020502@mrabarnett.plus.com> References: <55bab2a0-e0bc-4398-90b4-c9937498f5d8@googlegroups.com> <53FE5EDD.9020502@mrabarnett.plus.com> X-Mailer: Claws Mail 3.8.1 (GTK+ 2.24.10; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - boston.accountservergroup.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - tim.thechases.com X-Get-Message-Sender-Via: boston.accountservergroup.com: authenticated_id: tim@thechases.com 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: 18 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1409179587 news.xs4all.nl 2852 [2001:888:2000:d::a6]:39664 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:77170 On 2014-08-27 23:42, MRAB wrote: > How many parameters are there? len(self.param) > > Make that many placeholders and then join them together with commas: > > ', '.join(['?'] * len(self.param)) I prefer the clarity of Peter Otten's suggestion of ', '.join('?' * len(self.param)) over the mild obscurity of putting it in a list before multiplying. -tkc