Re: What is the "Unpacking Arguments List" rule?

2018-06-13 Thread Jach Fong
Alister via Python-list at 2018/6/13 PM 08:43 wrote: IMHO, there is no reason to check the *args has to appear at last in positional argument list in a function call because of there is no "unknown number of parameters" at the time of unpacking. It should be alright to write line 19 action(

Re: OFF-TOPIC Good sig [was Re: What is the "Unpacking Arguments List" rule?]

2018-06-13 Thread Ian Kelly
On Wed, Jun 13, 2018 at 10:10 AM Steven D'Aprano wrote: > > On Wed, 13 Jun 2018 12:43:12 +, Alister via Python-list wrote: > > > I have a theory that it's impossible to prove anything, but I can't > > prove it. > > Heh, that reminds me of Stephen Pinker's comment from "Enlightenment Now": > >

OFF-TOPIC Good sig [was Re: What is the "Unpacking Arguments List" rule?]

2018-06-13 Thread Steven D'Aprano
On Wed, 13 Jun 2018 12:43:12 +, Alister via Python-list wrote: > I have a theory that it's impossible to prove anything, but I can't > prove it. Heh, that reminds me of Stephen Pinker's comment from "Enlightenment Now": "one cannot reason that there's no such thing as reason" but on the oth

Re: What is the "Unpacking Arguments List" rule?

2018-06-13 Thread Alister via Python-list
On Wed, 13 Jun 2018 14:21:53 +0800, sa...@caprilion.com.tw wrote: > [Of the first part] > line 19 is > action(progress=progress, *args) > where the args is a tuple > args = (i, 3) > and the function is defined as > def action(id, reps, progress): > > In documents 4.7.2. Keyword Arg

Re: What is the "Unpacking Arguments List" rule?

2018-06-13 Thread sa...@caprilion.com.tw
[Of the first part] line 19 is action(progress=progress, *args) where the args is a tuple args = (i, 3) and the function is defined as def action(id, reps, progress): In documents 4.7.2. Keyword Arguments, it says ''' def parrot(voltage, state='a stiff', action='voom', type='Norwe

Re: What is the "Unpacking Arguments List" rule?

2018-06-12 Thread dieter
Jach Fong writes: > ... > 4.7.4. Unpacking Argument Lists > The reverse situation occurs when the arguments are already in a list or > tuple but need to be unpacked for a function call requiring separate > positional arguments. > ... args = [3, 6] list(range(*args)) > """ > > I can't

What is the "Unpacking Arguments List" rule?

2018-06-03 Thread Jach Fong
I had read "More on Defining Functions" sections of "The Python Tutorial" carefully yesterday. One thing in the example code(Re: How can an int be '+' with a tuple?) puzzles me again. It's the line 19: def progress(*any): threadQueue.put((onProgress, any + context)) action