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
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
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
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
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
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
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
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
"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
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
> 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
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
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
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
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
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
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
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
"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
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
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
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(,
22 matches
Mail list logo