Re: [Tutor] order of arguments in function

2006-12-06 Thread Eike Welk
On Wednesday 06 December 2006 13:29, Dick Moores wrote: > I meant that the order "min, max" is more intuitive than "max, > min". Don't you agree? And it's the order used in random.randint(), > random.randrange(), and random.uniform(), for examples. What about two intuitively named functions, like

Re: [Tutor] order of arguments in function

2006-12-06 Thread Michael Lange
On Wed, 06 Dec 2006 04:29:54 -0800 Dick Moores <[EMAIL PROTECTED]> wrote: (...) > > > >def my_function(min, max=None): > > if max is None: > > max = min > > min = 0 > > # stuff > > Great! > > >I am not sure if this is more intuitive though. > > >>> > def my_function(min

Re: [Tutor] order of arguments in function

2006-12-06 Thread Dick Moores
At 02:28 AM 12/6/2006, Michael Lange wrote: >On Tue, 05 Dec 2006 22:18:02 -0800 >Dick Moores <[EMAIL PROTECTED]> wrote: > > > Say I have a function, > > > > def my_function(max, min=0): > > return max - min > > > > The order of arguments is counterintuitive, but it seems it can't be > > change

Re: [Tutor] order of arguments in function

2006-12-06 Thread Michael Lange
On Tue, 05 Dec 2006 22:18:02 -0800 Dick Moores <[EMAIL PROTECTED]> wrote: > Say I have a function, > > def my_function(max, min=0): > return max - min > > The order of arguments is counterintuitive, but it seems it can't be > changed if I want to have a default min. Is there way to write >

[Tutor] order of arguments in function

2006-12-05 Thread Dick Moores
Say I have a function, def my_function(max, min=0): return max - min The order of arguments is counterintuitive, but it seems it can't be changed if I want to have a default min. Is there way to write def my_function(min=0, max): stuff Thanks, Dick Moores