python / python/cpython

The error messages of `dict()` and `dict().update()` should say `positional argument` instead of only `argument`

Open
#137,626 3 comments 0 reactions 1 assignee View on GitHub

@serhiy-storchaka is already working on this.

Since Aug 26, 2025.

interpreter-core type-bug
Dominant language
Python
Stars
77.2k
Forks
35.9k
PR merge metrics
PR metrics pending

Description

Setting 2 positional arguments to dict() and dict().update() gets the error messages saying only argument as shown below:

dict('John', 36)
dict().update('John', 36)
# Error

TypeError: dict expected at most 1 argument, got 2

TypeError: update expected at most 1 argument, got 2

But the error messages should say positional argument instead of only argument as shown below:

TypeError: dict expected at most 1 positional argument, got 2

TypeError: update expected at most 1 positional argument, got 2

Because setting 2 keyword arguments to dict() works as shown below:

dict(name='John', age=36)
dict().update(name='John', age=36)
# No error
Linked PRs
  • gh-137721

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.