Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-14 Thread Antoon Pardon
Op 2006-03-10, Diez B. Roggisch schreef <[EMAIL PROTECTED]>: >> Those default values are not 0 and , you may have >> only experience with situations where they behave as such but that >> is not the same. > > Well, it might be - but the conceptual behavior is (usually) the same. > >> If you need to

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-14 Thread Antoon Pardon
Op 2006-03-10, Terry Reedy schreef <[EMAIL PROTECTED]>: > > "Antoon Pardon" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> but nobody seems to have >> a problem with range(n) where n suddenly is the second parameter and >> we use the default for the first. > > Actually, I conside

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-14 Thread Antoon Pardon
Op 2006-03-10, Terry Reedy schreef <[EMAIL PROTECTED]>: > > "Antoon Pardon" <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> but nobody seems to have >> a problem with range(n) where n suddenly is the second parameter and >> we use the default for the first. > > Actually, I conside

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Steven D'Aprano
On Fri, 10 Mar 2006 11:33:56 -0500, Terry Reedy wrote: > Actually, I consider the unique calling pattern for x/range to be something > of a wart. Learning this inconsistency was at least a minor problem. It > is a rather extreme example of typing laziness beats purity. Amazing. I consider it

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Steven D'Aprano
On Fri, 10 Mar 2006 12:06:57 +0300, Dmitry Anikin wrote: > I mean, it's very convenient when default parameters > can be in any position, like > def a_func(x = 2, y = 1, z): > ... > (that defaults must go last is really a C++ quirk which > is needed for overload resolution, isn't it?) I'm con

Re: Why python doesn't use syntax like function(,,x) for default parameters?

2006-03-10 Thread Michal Kwiatkowski
Dmitry Anikin napisaƂ(a): > Some example (from real life). > def ChooseItems(StartDate, EndDate, Filter): > #function returns a set of some items in chronological order > #from required interval possibly using filter > > ChooseItems() #get everything > ChooseItems('01.01.2000', ,SomeFilter) #get e

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Dmitry Anikin
Some example (from real life). def ChooseItems(StartDate, EndDate, Filter): #function returns a set of some items in chronological order #from required interval possibly using filter ChooseItems() #get everything ChooseItems('01.01.2000', ,SomeFilter) #get everything after a date using filter Choo

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Dmitry Anikin
Some example (from real life). def ChooseItems(StartDate, EndDate, Filter): #function returns a set of some items in chronological order #from required interval possibly using filter ChooseItems() #get everything ChooseItems('01.01.2000', ,SomeFilter) #get everything after a date using filter Choo

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Terry Reedy
"Antoon Pardon" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > but nobody seems to have > a problem with range(n) where n suddenly is the second parameter and > we use the default for the first. Actually, I consider the unique calling pattern for x/range to be something of a wart

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Roy Smith
Antoon Pardon <[EMAIL PROTECTED]> wrote: >Do you have trouble remembering that range(n) is actually providing the >second parameter to the function and what it does? Yes. I don't use range() everyday, and it's very rare that I use more than one argument. I do remember that there are additional

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Diez B. Roggisch
> Those default values are not 0 and , you may have > only experience with situations where they behave as such but that > is not the same. Well, it might be - but the conceptual behavior is (usually) the same. > If you need to know these values then you will need to know them > just as much whe

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Antoon Pardon
Op 2006-03-10, Roy Smith schreef <[EMAIL PROTECTED]>: > In article <[EMAIL PROTECTED]>, > Antoon Pardon <[EMAIL PROTECTED]> wrote: > >> Op 2006-03-10, Roy Smith schreef <[EMAIL PROTECTED]>: >> > "Dmitry Anikin" <[EMAIL PROTECTED]> wrote: >> >> There are often situations when a function has indepen

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Antoon Pardon
Op 2006-03-10, Diez B. Roggisch schreef <[EMAIL PROTECTED]>: > Antoon Pardon wrote: > >>> >>> Specifying the names of the keyword parameters costs you a little typing >>> once, but saves everybody (including yourself) a lot of grief later when >>> you're trying to figure out what the heck your code

Re: Why python doesn't use syntax like function(,,x) for default parameters?

2006-03-10 Thread Juho Schultz
Antoon Pardon wrote: > Op 2006-03-10, Roy Smith schreef <[EMAIL PROTECTED]>: > >>"Dmitry Anikin" <[EMAIL PROTECTED]> wrote: >> >>>There are often situations when a function has independent >>>parameters, all having reasonable defaults, and I want to >>>provide just several of them. In fact, I can

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Roy Smith
In article <[EMAIL PROTECTED]>, Antoon Pardon <[EMAIL PROTECTED]> wrote: > Op 2006-03-10, Roy Smith schreef <[EMAIL PROTECTED]>: > > "Dmitry Anikin" <[EMAIL PROTECTED]> wrote: > >> There are often situations when a function has independent > >> parameters, all having reasonable defaults, and I wa

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Diez B. Roggisch
Antoon Pardon wrote: >> >> Specifying the names of the keyword parameters costs you a little typing >> once, but saves everybody (including yourself) a lot of grief later when >> you're trying to figure out what the heck your code does 6 months later. > > Could you explain what is so hard in figu

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Antoon Pardon
Op 2006-03-10, Roy Smith schreef <[EMAIL PROTECTED]>: > "Dmitry Anikin" <[EMAIL PROTECTED]> wrote: >> There are often situations when a function has independent >> parameters, all having reasonable defaults, and I want to >> provide just several of them. In fact, I can do it using >> keyword parame

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Steve Holden
Dmitry Anikin wrote: > I mean, it's very convenient when default parameters > can be in any position, like > def a_func(x = 2, y = 1, z): > ... > (that defaults must go last is really a C++ quirk which > is needed for overload resolution, isn't it?) > I've no idea why C++ required defaults las

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Roy Smith
"Dmitry Anikin" <[EMAIL PROTECTED]> wrote: > There are often situations when a function has independent > parameters, all having reasonable defaults, and I want to > provide just several of them. In fact, I can do it using > keyword parameters, but it's rather long and you have to > remember/lookup

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Terry Hancock
On 10 Mar 2006 09:51:01 GMT Duncan Booth <[EMAIL PROTECTED]> wrote: > Dmitry Anikin wrote: > > Is there some contradiction in python syntax which > > disallows an easy implementation of this feature, or > > just nobody bothered with this? If former is the case, > > please show me why, because I bad

Re: Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Duncan Booth
Dmitry Anikin wrote: > Is there some contradiction in python syntax which disallows > an easy implementation of this feature, or just nobody bothered > with this? If former is the case, please show me why, because > I badly need this feature in embedded python app (for > compatibility with other l

Why python doesn't use syntax like function(, , x) for default parameters?

2006-03-10 Thread Dmitry Anikin
I mean, it's very convenient when default parameters can be in any position, like def a_func(x = 2, y = 1, z): ... (that defaults must go last is really a C++ quirk which is needed for overload resolution, isn't it?) and when calling, just omit parameter when you want to use defaults: a_func(,