Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!newsfeed.xs4all.nl!newsfeed5.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: OK 0.002 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'argument': 0.04; 'arguments': 0.07; 'list?': 0.07; 'python': 0.09; 'cc:addr:python- list': 0.10; 'index': 0.13; 'definition.': 0.16; 'parameters,': 0.16; 'sequential': 0.16; 'subject:pass': 0.16; 'wrote:': 0.17; 'thanks,': 0.18; 'cc:2**0': 0.23; 'bruce': 0.23; 'statement': 0.23; 'cc:no real name:2**0': 0.24; 'pass': 0.25; 'cc:addr:python.org': 0.25; 'header:In-Reply-To:1': 0.25; 'header :User-Agent:1': 0.26; 'clever': 0.29; 'function': 0.30; 'handle': 0.33; 'list': 0.35; 'there': 0.35; 'does': 0.37; 'listing': 0.37; 'subject:: ': 0.38; 'received:194': 0.61; 'email addr:gmail.com': 0.63; 'subject:there': 0.65 X-IronPort-AV: E=Sophos;i="4.77,739,1336341600"; d="scan'208";a="643961" X-Virus-Scanned: amavisd-new at zimbra.sequans.com Date: Thu, 09 Aug 2012 11:05:30 +0200 From: Jean-Michel Pichavant User-Agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100328) MIME-Version: 1.0 To: bruceg113355@gmail.com Subject: Re: Is there a clever way to pass arguments References: <0aaad6e4-8751-4073-bf9c-14285c1f3422@googlegroups.com> In-Reply-To: <0aaad6e4-8751-4073-bf9c-14285c1f3422@googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 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: 21 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1344503139 news.xs4all.nl 6860 [2001:888:2000:d::a6]:59873 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:26782 bruceg113355@gmail.com wrote: > Is there a way in Python to pass arguments without listing each argument? > For example, my program does the following: > > testData (z[0], z[1], z[2], z[3], z[4], z[5], z[6], z[7]) > > Is there a clever way to pass arguments in a single statement knowing that each argument is a sequential index from a list? > I cannot change the function definition. > > Thanks, > Bruce > testData(*z) or better (imo) testData(z) and make testData handle a list (8 parameters, that's a lot of parameters). JM