Antoon Pardon wrote:
> On 2006-10-12, Magnus Lycka <[EMAIL PROTECTED]> wrote:
>
>>Antoon Pardon wrote:
>>
>>>Well maybe he didn't intend that, but how is the reader of the
>>>documentation to know that? The reader can only go by how
>>>things are documented. If those are not entirely consistent
>>
On 2006-10-12, Magnus Lycka <[EMAIL PROTECTED]> wrote:
> Antoon Pardon wrote:
>> Well maybe he didn't intend that, but how is the reader of the
>> documentation to know that? The reader can only go by how
>> things are documented. If those are not entirely consistent
>> with the intend of the progr
Antoon Pardon wrote:
> Well maybe he didn't intend that, but how is the reader of the
> documentation to know that? The reader can only go by how
> things are documented. If those are not entirely consistent
> with the intend of the programmer, that is not the readers
> fault.
I don't think I ever
On 6 Oct 2006 10:57:01 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote:
> Again that is not the fault of those that read the documentation. If
> this discinction can't be easily made in python 2.X, you can't fault
> the reader for coming to a conclusion that seems to follow rather
> naturally from ho
On Fri, 06 Oct 2006 12:42:08 +0200, Fredrik Lundh wrote:
> Antoon Pardon wrote:
>
>> IMO this is a very natural thought process for a python programmer.
>> So a python programmer seeing the first will tend to expect that
>> last call to work.
>
> on the other hand, if a Python programmer *writes
On 2006-10-06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Antoon Pardon wrote:
>
>> IMO this is a very natural thought process for a python programmer.
>> So a python programmer seeing the first will tend to expect that
>> last call to work.
>
> on the other hand, if a Python programmer *writes* so
Antoon Pardon wrote:
> IMO this is a very natural thought process for a python programmer.
> So a python programmer seeing the first will tend to expect that
> last call to work.
on the other hand, if a Python programmer *writes* some code instead;
say, a trivial function like:
def calc
On 2006-10-06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> hanumizzle wrote:
>
>> Not sure exactly what is going on / being argued about in this
> > thread
>
> I'm describing best practices based on long experience of using and
> developing and teaching and writing about Python stuff. Others have
On 2006-10-06, hanumizzle <[EMAIL PROTECTED]> wrote:
> On 6 Oct 2006 09:21:11 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote:
>> On 2006-10-06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
>> > Antoon Pardon wrote:
>> >
>> >> Is this general rules documeted somewhere? My impression is that readers
>> >>
hanumizzle wrote:
> Not sure exactly what is going on / being argued about in this
> thread
I'm describing best practices based on long experience of using and
developing and teaching and writing about Python stuff. Others have
other priorities, it seems.
> This doesn't say anything positiv
On 6 Oct 2006 09:21:11 GMT, Antoon Pardon <[EMAIL PROTECTED]> wrote:
> On 2006-10-06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> > Antoon Pardon wrote:
> >
> >> Is this general rules documeted somewhere? My impression is that readers
> >> of the documentation will treat arguments as keyword argumen
On 2006-10-06, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Antoon Pardon wrote:
>
>> Is this general rules documeted somewhere? My impression is that readers
>> of the documentation will treat arguments as keyword arguments unless
>> this is explicitly contradicted.
>
> Sorry, I missed that this was
Antoon Pardon wrote:
> Is this general rules documeted somewhere? My impression is that readers
> of the documentation will treat arguments as keyword arguments unless
> this is explicitly contradicted.
Sorry, I missed that this was comp.lang.python.alternate.reality. My
mistake.
--
http://
On 2006-10-04, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Georg Brandl wrote:
>
>> This is an issue in most Python documentation: you're not told
>> if the described function is implemented in C, and if it is
>> keyword arg-enabled. The arguments must be given names though,
>> to be able to documen
Ben Finney wrote:
> Perhaps you meant something other than "if the documentation doesn't
> explicitly say that something is a keyword argument, it isn't", then.
I'm sure it's perfectly possibly to use your foot as a door stop, but
does that really mean that it is one?
--
http://mail.python.o
Fredrik Lundh <[EMAIL PROTECTED]> writes:
> Gabriel Genellina wrote:
>
> >> > the general rule is that if the documentation doesn't
> >> > explicitly say that something is a keyword argument, it isn't,
> >> > and shouldn't be treated as such.
>
> you guys need to look up the words "should" and "no
Gabriel Genellina wrote:
>> > the general rule is that if the documentation doesn't explicitly say
>> > that something is a keyword argument, it isn't, and shouldn't be
>> > treated as such.
>>
>> The first module I looked in to check this, it wasn't true. In the Queue
>> Module is isn't explicit
At Thursday 5/10/2006 11:41, Antoon Pardon wrote:
> the general rule is that if the documentation doesn't explicitly say
> that something is a keyword argument, it isn't, and shouldn't be treated
> as such.
The first module I looked in to check this, it wasn't true. In the Queue
Module is isn't
Fredrik Lundh wrote:
> Antoon Pardon wrote:
>
>
>>The first module I looked in to check this, it wasn't true. In the Queue
>>Module is isn't explicitly written that maxsize is a keyword argument yet
>>Queue.Queue(maxsize=9) works just fine.
>
>
> it's not a matter whether it works fine in any g
Antoon Pardon wrote:
> The first module I looked in to check this, it wasn't true. In the Queue
> Module is isn't explicitly written that maxsize is a keyword argument yet
> Queue.Queue(maxsize=9) works just fine.
it's not a matter whether it works fine in any given version of Python,
it's a mat
On 2006-10-04, Fredrik Lundh <[EMAIL PROTECTED]> wrote:
> Georg Brandl wrote:
>
>> This is an issue in most Python documentation: you're not told
>> if the described function is implemented in C, and if it is
>> keyword arg-enabled. The arguments must be given names though,
>> to be able to documen
Georg Brandl wrote:
> This is an issue in most Python documentation: you're not told
> if the described function is implemented in C, and if it is
> keyword arg-enabled. The arguments must be given names though,
> to be able to document them.
the general rule is that if the documentation doesn't
Paul Rubin wrote:
> Antoon Pardon <[EMAIL PROTECTED]> writes:
>> repeat(object[, times])
>> Make an iterator that returns object over and over again. Runs
>> indefinitely unless the times argument is specified. ...
>>
>> My first impression from this, is that it is possible to call
>> this
On 2006-10-04, Antoon Pardon <[EMAIL PROTECTED]> wrote:
> On 2006-10-03, LaundroMat <[EMAIL PROTECTED]> wrote:
>> Suppose I have this function:
>>
>> def f(var=1):
>> return var*2
>>
>> What value do I have to pass to f() if I want it to evaluate var to 1?
>> I know that f() will return 2, but what
On 2006-10-03, LaundroMat <[EMAIL PROTECTED]> wrote:
> Suppose I have this function:
>
> def f(var=1):
> return var*2
>
> What value do I have to pass to f() if I want it to evaluate var to 1?
> I know that f() will return 2, but what if I absolutely want to pass a
> value to f()? "None" doesn't se
Antoon Pardon <[EMAIL PROTECTED]> writes:
> repeat(object[, times])
> Make an iterator that returns object over and over again. Runs
> indefinitely unless the times argument is specified. ...
>
> My first impression from this, is that it is possible to call
> this as follows:
> repeat(No
On 2006-10-04, Georg Brandl <[EMAIL PROTECTED]> wrote:
> Antoon Pardon wrote:
>> On 2006-10-04, Paul Rubin wrote:
>>> Antoon Pardon <[EMAIL PROTECTED]> writes:
Now in this case you could start by assigning arg the value 1 and
eliminate the if test. However that only works if you know the
Antoon Pardon wrote:
> On 2006-10-04, Paul Rubin wrote:
>> Antoon Pardon <[EMAIL PROTECTED]> writes:
>>> Now in this case you could start by assigning arg the value 1 and
>>> eliminate the if test. However that only works if you know the
>>> default value for the argument. What he seems to be aski
On 2006-10-04, Nick Craig-Wood <[EMAIL PROTECTED]> wrote:
> Antoon Pardon <[EMAIL PROTECTED]> wrote:
>> One possible way to do what I think you want is to code as follows:
>>
>> class Default (object):
>>pass
>
> I'd have written
>
> Default = object()
>
>> def f(var=Default):
>>if var
On 2006-10-04, Paul Rubin wrote:
> Antoon Pardon <[EMAIL PROTECTED]> writes:
>> Now in this case you could start by assigning arg the value 1 and
>> eliminate the if test. However that only works if you know the
>> default value for the argument. What he seems to be asking for
>> is if there is an
Antoon Pardon <[EMAIL PROTECTED]> wrote:
> One possible way to do what I think you want is to code as follows:
>
> class Default (object):
>pass
I'd have written
Default = object()
> def f(var=Default):
>if var is Default:
> var = 1
>return var * 2
>
But yes, defining a se
LaundroMat <[EMAIL PROTECTED]> wrote:
> I have in fact a bunch of functions that all pass similar information
> to one main function. That function takes (amongst others) a template
> variable. If it's not being passed, it is set to a default value by the
> function called upon.
>
> For the m
On 2006-10-04, Paul Rubin wrote:
> "LaundroMat" <[EMAIL PROTECTED]> writes:
>> def f(var=1):
>> return var*2
>>
>> What value do I have to pass to f() if I want it to evaluate var to 1?
>> I know that f() will return 2, but what if I absolutely want to pass a
>> value to f()? "None" doesn't seem
Antoon Pardon <[EMAIL PROTECTED]> writes:
> Now in this case you could start by assigning arg the value 1 and
> eliminate the if test. However that only works if you know the
> default value for the argument. What he seems to be asking for
> is if there is an object, (let as call it Default), that
Antoon Pardon wrote:
> The problem is like the following.
>
> def f(var=1):
> return var*2
>
> def g():
> arg = None
> try:
> arg = Try_Processing() / 3 + 1
> except Nothing_To_Process:
> pass
> if arg is None:
> return f()
> else:
> return f(arg)
>
> Now in this case y
"LaundroMat" <[EMAIL PROTECTED]> writes:
> def f(var=1):
> return var*2
>
> What value do I have to pass to f() if I want it to evaluate var to 1?
> I know that f() will return 2, but what if I absolutely want to pass a
> value to f()? "None" doesn't seem to work..
I don't understand your questio
Rob De Almeida wrote:
> LaundroMat wrote:
> > Suppose I have this function:
> >
> > def f(var=1):
> > return var*2
> >
> > What value do I have to pass to f() if I want it to evaluate var to 1?
> > I know that f() will return 2, but what if I absolutely want to pass a
> > value to f()? "None" doe
On 2006-10-03, LaundroMat <[EMAIL PROTECTED]> wrote:
> Suppose I have this function:
>
> def f(var=1):
> return var*2
>
> What value do I have to pass to f() if I want it to evaluate var to 1?
> I know that f() will return 2, but what if I absolutely want to pass a
> value to f()? "None" doesn't se
LaundroMat wrote:
> Suppose I have this function:
>
> def f(var=1):
> return var*2
>
> What value do I have to pass to f() if I want it to evaluate var to 1?
> I know that f() will return 2, but what if I absolutely want to pass a
> value to f()? "None" doesn't seem to work..
If you *absolutely* w
LaundroMat a écrit :
> Suppose I have this function:
>
> def f(var=1):
> return var*2
>
> What value do I have to pass to f() if I want it to evaluate var to 1?
>
> I know that f() will return 2, but what if I absolutely want to pass a
> value to f()? "None" doesn't seem to work..
Have you trie
LaundroMat wrote:
> Suppose I have this function:
>
> def f(var=1):
> return var*2
>
> What value do I have to pass to f() if I want it to evaluate var to 1?
> I know that f() will return 2, but what if I absolutely want to pass a
> value to f()? "None" doesn't seem to work..
What about this?
>>
On Tue, 03 Oct 2006 13:16:57 -0700, "LaundroMat" <[EMAIL PROTECTED]> let
this slip:
> Suppose I have this function:
>
> def f(var=1):
> return var*2
>
> What value do I have to pass to f() if I want it to evaluate var to 1?
> I know that f() will return 2, but what if I absolutely want to pass a
LaundroMat wrote:
> Suppose I have this function:
>
> def f(var=1):
> return var*2
>
> What value do I have to pass to f() if I want it to evaluate var to 1?
> I know that f() will return 2, but what if I absolutely want to pass a
> value to f()? "None" doesn't seem to work..
>
> Thanks in advan
> def f(var=1):
> return var*2
>
> What value do I have to pass to f() if I want it to evaluate var to 1?
> I know that f() will return 2, but what if I absolutely want to pass a
> value to f()? "None" doesn't seem to work..
>>> def f(var=1):
... return var*2
...
>>> f()
2
>>> f(0.5)
1.0
LaundroMat <[EMAIL PROTECTED]> wrote:
> What value do I have to pass to f() if I want it to evaluate var to 1?
> I know that f() will return 2, but what if I absolutely want to pass a
> value to f()? "None" doesn't seem to work..
I don't know if I understand correctly here but:
def f(v=1):
re
LaundroMat wrote:
> Suppose I have this function:
>
> def f(var=1):
> return var*2
>
> What value do I have to pass to f() if I want it to evaluate var to 1?
> I know that f() will return 2, but what if I absolutely want to pass a
> value to f()?
f(1)
> "None" doesn't seem to work..
None is
Suppose I have this function:
def f(var=1):
return var*2
What value do I have to pass to f() if I want it to evaluate var to 1?
I know that f() will return 2, but what if I absolutely want to pass a
value to f()? "None" doesn't seem to work..
Thanks in advance.
--
http://mail.python.org/mailma
47 matches
Mail list logo