arguments to functions

Bengt Richter bokr at oz.net
Mon Jul 1 15:05:22 EDT 2002


On Mon, 01 Jul 2002 11:10:44 GMT, "Fredrik Lundh" <fredrik at pythonware.com> wrote:

>Bengt Richter wrote:
>
>>  >>> test(10, 11, 12, expected=5)
>>  Traceback (most recent call last):
>>    File "<stdin>", line 1, in ?
>>  TypeError: test() got multiple values for keyword argument 'expected'
>>
>> I'd be inclined to call that a bug, actually.
>
>only if you're ignoring the language reference, which tells
>you how this really works.
>
Yes, my "inclination" to call it a bug was wrt how-I-think-maybe-it-should-work,
so I was only inclined to, not actually doing it ;-)

What would break by allowing keyword parameter names to duplicate
ordinary parameter names? IWT probably nothing at this point, since it's not allowed.

New code would presumably either be written to use the feature, or at worst have
a new way to make a programming error without the current error message.

Regards,
Bengt Richter



More information about the Python-list mailing list