[ python-Bugs-1496278 ] Incorrect error message related to **kwargs

SourceForge.net noreply at sourceforge.net
Mon May 29 16:48:50 CEST 2006


Bugs item #1496278, was opened at 2006-05-28 06:36
Message generated for change (Comment added) made by gbrandl
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1496278&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Interpreter Core
Group: Python 2.5
>Status: Closed
>Resolution: Duplicate
Priority: 5
Submitted By: Collin Winter (collinwinter)
Assigned to: Nobody/Anonymous (nobody)
Summary: Incorrect error message related to **kwargs

Initial Comment:
"""
>>> def foo(**kwargs):
...     pass
...
>>> foo(5, 6)
TypeError: foo() takes exactly 0 arguments (2 given)
"""

It clearly does take arguments, just not positional
arguments.

The attached patch changes the message above to "foo()
takes exactly 0 non-keyword arguments", as well as
changing the message in several other, similar cases.

The patch also updates Lib/test/output/test_extcall
appropriately.

The patch is against r46495.

----------------------------------------------------------------------

>Comment By: Georg Brandl (gbrandl)
Date: 2006-05-29 14:48

Message:
Logged In: YES 
user_id=849994

This is the same problem described in #1283289.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1496278&group_id=5470


More information about the Python-bugs-list mailing list