Re: [Tutor] Defining variable arguments in a function in python

2018-12-31 Thread boB Stepp
On Mon, Dec 31, 2018 at 10:36 AM David Rock wrote: > > > On Dec 30, 2018, at 18:39, Alan Gauld via Tutor wrote: > > > > On 30/12/2018 22:25, Avi Gross wrote: > > > >> I admit I have not studied the charter for the group. > > > > As moderator I feel the need to step in here because the > >

Re: [Tutor] Defining variable arguments in a function in python

2018-12-31 Thread David Rock
> On Dec 30, 2018, at 18:39, Alan Gauld via Tutor wrote: > > On 30/12/2018 22:25, Avi Gross wrote: > >> I admit I have not studied the charter for the group. > > As moderator I feel the need to step in here because the > charter is extremely apropos to that function and some > clarification

Re: [Tutor] Defining variable arguments in a function in python

2018-12-30 Thread Steven D'Aprano
On Sun, Dec 30, 2018 at 11:07:19AM -0500, Avi Gross wrote: > Steve, > > I had the same thoughts and many more when I played with these ideas > last night. Pity that one of those thoughts wasn't "I shouldn't suggest a bad solution on a mailing list populated by beginners who won't recognise

Re: [Tutor] Defining variable arguments in a function in python

2018-12-30 Thread Alan Gauld via Tutor
On 30/12/2018 22:25, Avi Gross wrote: > I admit I have not studied the charter for the group. As moderator I feel the need to step in here because the charter is extremely apropos to that function and some clarification may be helpful. Mark is correct in that the group is focused on the core

Re: [Tutor] Defining variable arguments in a function in python

2018-12-30 Thread Avi Gross
variable arguments in a function in python On 30/12/2018 17:26, Avi Gross wrote: > Replying to Steve's points. Again, it was not a serious design and > said so but was an ACADEMIC exploration of what could be done. I fully > agree with Steve that it is probably not a great i

Re: [Tutor] Defining variable arguments in a function in python

2018-12-30 Thread Mark Lawrence
On 30/12/2018 17:26, Avi Gross wrote: Replying to Steve's points. Again, it was not a serious design and said so but was an ACADEMIC exploration of what could be done. I fully agree with Steve that it is probably not a great idea to do this but note the original request might not have been a

Re: [Tutor] Defining variable arguments in a function in python

2018-12-30 Thread Avi Gross
Sent: Sunday, December 30, 2018 5:39 AM To: tutor@python.org Subject: Re: [Tutor] Defining variable arguments in a function in python. So everything Steve says as commentary and even criticism is indeed true. It is a bug magnet and so on. So is just about any code I have seen, albeit not as bad

Re: [Tutor] Defining variable arguments in a function in python

2018-12-30 Thread Avi Gross
angerous. This message is long enough. I will reply to Steven's specific points in a bit. Still on vacation  -Original Message- From: Tutor On Behalf Of Steven D'Aprano Sent: Sunday, December 30, 2018 5:39 AM To: tutor@python.org Subject: Re: [Tutor] Defining variable arguments in a fu

Re: [Tutor] Defining variable arguments in a function in python

2018-12-30 Thread Karthik Bhat
> from the command line but it may satisfy some need. > > Other than that, I fully agree that the current python spec cannot support > anything like this in the function definition. > > Side note: To spare others, I sent Steven alone a deeper reply about ways > to > se

Re: [Tutor] Defining variable arguments in a function in python

2018-12-30 Thread Peter Otten
Avi Gross wrote: > To spare others, Thank you for that. > I sent Steven alone 'Tis well deserved ;) ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: https://mail.python.org/mailman/listinfo/tutor

Re: [Tutor] Defining variable arguments in a function in python

2018-12-30 Thread Steven D'Aprano
On Sun, Dec 30, 2018 at 12:07:20AM -0500, Avi Gross wrote: [...] > Or on a more practical level, say a function wants an input from 1 to 10. > The if statement above can be something like: > > >>> def hello(a, *n, **m) : > if not (1 <= a <= 10) : a=5 > print(a) > print(*n) > >

Re: [Tutor] Defining variable arguments in a function in python

2018-12-29 Thread Avi Gross
I am still learning how pandas works and doubt many others here have any immediate needs. -----Original Message- From: Tutor On Behalf Of Steven D'Aprano Sent: Saturday, December 29, 2018 6:02 AM To: tutor@python.org Subject: Re: [Tutor] Defining variable arguments in a function

Re: [Tutor] Defining variable arguments in a function in python

2018-12-29 Thread Peter Otten
Karthik Bhat wrote: > Hello, > > I have the following piece of code. In this, I wanted to make use > of the optional parameter given to 'a', i.e- '5', and not '1' > > def fun_varargs(a=5, *numbers, **dict): > print("Value of a is",a) > > for i in numbers: > print("Value

Re: [Tutor] Defining variable arguments in a function in python

2018-12-29 Thread Steven D'Aprano
On Sat, Dec 29, 2018 at 11:42:16AM +0530, Karthik Bhat wrote: > Hello, > > I have the following piece of code. In this, I wanted to make use > of the optional parameter given to 'a', i.e- '5', and not '1' > > def fun_varargs(a=5, *numbers, **dict): [...] > >

Re: [Tutor] Defining variable arguments in a function in python

2018-12-29 Thread Alan Gauld via Tutor
On 29/12/2018 06:12, Karthik Bhat wrote: > def fun_varargs(a=5, *numbers, **dict): > print("Value of a is",a) > > for i in numbers: > print("Value of i is",i) > > for i, j in dict.items(): > print("The value of i and j are:",i,j) > >

[Tutor] Defining variable arguments in a function in python

2018-12-29 Thread Karthik Bhat
Hello, I have the following piece of code. In this, I wanted to make use of the optional parameter given to 'a', i.e- '5', and not '1' def fun_varargs(a=5, *numbers, **dict): print("Value of a is",a) for i in numbers: print("Value of i is",i) for i, j in