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
>> >> 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.
>> >
>>
>> A personal attack won't make my argument go away. It also doesn't
>> answer my question.
>
> Not sure exactly what is going on / being argued about in this thread but HTH 
> :?
>
> http://docs.python.org/tut/node6.html
>
> This doesn't say anything positive or negative about the practice in
> question, but does point out that it is possible. I think it is a
> reasonable assumption that if it isn't necessary, most users will
> elide the keywords.

What I am argueing is that it is very natural for python programmers to
assume that keyword arguments will work if they see a signature. IMO
if a python programmer sees something like:

  abs(x)

It is very natural to envision a corresponding def statement like:

  def abs(x):

and a python function written like this will work if called as
follows:

  abs(x=5)

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.

Now frederic claims that the general rule is different. Now I'm
perfectly happy to accept that those who write the documentation
do so based aacording to the rule frederic stated (you can't/shouldn't
use a parameter as a keyword argument unless explictly stated in the
documentation), but that doesn't contradict that readers may have
different expectations.

-- 
Antoon Pardon
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to