Re: Is there a clever way to pass arguments

2012-08-09 Thread Terry Reedy
On 8/9/2012 5:50 AM, Jean-Michel Pichavant wrote: Chris Angelico wrote: On Thu, Aug 9, 2012 at 7:05 PM, Jean-Michel Pichavant wrote: bruceg113...@gmail.com wrote: I cannot change the function definition. or better (imo) testData(z) and make testData handle a list (8 parameters, that's a lot

Re: Is there a clever way to pass arguments

2012-08-09 Thread GangGreene
Alister wrote: [putolin] > some people read these threads to learn general concepts & not to find > answers to a single explicit case. Some people (me) don't know the first thing about python and are in the learning/exploratory phase. -- http://mail.python.org/mailman/listinfo/python-list

Re: Is there a clever way to pass arguments

2012-08-09 Thread Alister
On Thu, 09 Aug 2012 19:13:31 +1000, Chris Angelico wrote: > On Thu, Aug 9, 2012 at 7:05 PM, Jean-Michel Pichavant > wrote: >> bruceg113...@gmail.com wrote: >>> >>> I cannot change the function definition. >> >> or better (imo) >> testData(z) and make testData handle a list (8 parameters, that's a

Re: Is there a clever way to pass arguments

2012-08-09 Thread Jean-Michel Pichavant
Chris Angelico wrote: On Thu, Aug 9, 2012 at 7:05 PM, Jean-Michel Pichavant wrote: bruceg113...@gmail.com wrote: I cannot change the function definition. or better (imo) testData(z) and make testData handle a list (8 parameters, that's a lot of parameters). He can't chan

Re: Is there a clever way to pass arguments

2012-08-09 Thread Chris Angelico
On Thu, Aug 9, 2012 at 7:05 PM, Jean-Michel Pichavant wrote: > bruceg113...@gmail.com wrote: >> >> I cannot change the function definition. > > or better (imo) > testData(z) and make testData handle a list (8 parameters, that's a lot of > parameters). He can't change the function definition. Chr

Re: Is there a clever way to pass arguments

2012-08-09 Thread Jean-Michel Pichavant
bruceg113...@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

Re: Is there a clever way to pass arguments

2012-08-08 Thread Steven D'Aprano
On Wed, 08 Aug 2012 18:20:40 -0700, bruceg113355 wrote: > z = [] > z.append(0) > z.append(1) > z.append(2) > z.append(3) > z.append(4) > z.append(5) > z.append(6) > z.append(7) That can be written as: z = [0, 1, 2, 3, 4, 5, 6, 7] Or better still: z = range(8) # In Python 3, use list(range(8))

Re: Is there a clever way to pass arguments

2012-08-08 Thread bruceg113355
> > 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. >

Re: Is there a clever way to pass arguments

2012-08-08 Thread Dave Angel
On 08/08/2012 08:41 PM, bruceg113...@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 arg

Re: Is there a clever way to pass arguments

2012-08-08 Thread Andrew Cooper
On 09/08/2012 01:41, bruceg113...@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 arg

Is there a clever way to pass arguments

2012-08-08 Thread bruceg113355
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