Skip to content

Typo in OrderedDict.OrderedDict exception message #138516

@asas1asas200

Description

@asas1asas200

Bug report

Bug description:

There is a trailing s at TypeError exception message from initializer of collecitons.OrderedDict.

Test code:

import collections
collections.OrderedDict(1, 2, 3)

And result shows:

Traceback (most recent call last):
  File "<python-input-1>", line 2, in <module>
    collections.OrderedDict(1, 2, 3)
    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
TypeError: expected at most 1 arguments, got 3

There is a trailing s at argument.

In other cases, it will show argument if only one argument expected:

import collections

list(1, 2, 3) # TypeError: list expected at most 1 argument, got 3
dict(1, 2, 3) # TypeError: dict expected at most 1 argument, got 3
set(1, 2, 3) # TypeError: set expected at most 1 argument, got 3
collections.OrderedDict(1, 2, 3) # TypeError: expected at most 1 arguments, got 3

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions