Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect error message related to **kwargs #43424

Closed
collinwinter mannequin opened this issue May 28, 2006 · 3 comments
Closed

Incorrect error message related to **kwargs #43424

collinwinter mannequin opened this issue May 28, 2006 · 3 comments
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error

Comments

@collinwinter
Copy link
Mannequin

collinwinter mannequin commented May 28, 2006

BPO 1496278
Nosy @birkenfeld
Files
  • better_kwargs_error_msg.patch: Improve **kwargs-related error message, against r46495
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2013-04-13.03:25:38.774>
    created_at = <Date 2006-05-28.06:36:23.000>
    labels = ['interpreter-core', 'type-bug']
    title = 'Incorrect error message related to **kwargs'
    updated_at = <Date 2013-04-13.03:25:38.774>
    user = 'https://bugs.python.org/collinwinter'

    bugs.python.org fields:

    activity = <Date 2013-04-13.03:25:38.774>
    actor = 'tallpaul'
    assignee = 'none'
    closed = True
    closed_date = None
    closer = None
    components = ['Interpreter Core']
    creation = <Date 2006-05-28.06:36:23.000>
    creator = 'collinwinter'
    dependencies = []
    files = ['2017']
    hgrepos = []
    issue_num = 1496278
    keywords = []
    message_count = 3.0
    messages = ['28663', '28664', '186692']
    nosy_count = 3.0
    nosy_names = ['georg.brandl', 'collinwinter', 'tallpaul']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = None
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue1496278'
    versions = ['Python 2.5', 'Python 2.7', 'Python 3.2']

    @collinwinter
    Copy link
    Mannequin Author

    collinwinter mannequin commented May 28, 2006

    """
    >>> 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.

    @collinwinter collinwinter mannequin closed this as completed May 28, 2006
    @collinwinter collinwinter mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label May 28, 2006
    @collinwinter collinwinter mannequin closed this as completed May 28, 2006
    @collinwinter collinwinter mannequin added the interpreter-core (Objects, Python, Grammar, and Parser dirs) label May 28, 2006
    @birkenfeld
    Copy link
    Member

    Logged In: YES
    user_id=849994

    This is the same problem described in bpo-1283289.

    @tallpaul
    Copy link
    Mannequin

    tallpaul mannequin commented Apr 13, 2013

    This wasn't fixed by the patch for bpo-1283289.
    (Still true of at least 2.7.3 and 3.2.3)

    @tallpaul tallpaul mannequin added type-bug An unexpected behavior, bug, or error labels Apr 13, 2013
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    interpreter-core (Objects, Python, Grammar, and Parser dirs) type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant