python / python/cpython

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

Aperta
#137,626 3 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@serhiy-storchaka ci sta già lavorando.

Dal 26/8/2025.

interpreter-core type-bug
Lingua principale
Python
Stelle
77.2k
Fork
35.9k
Metriche di merge delle PR
Metriche PR in attesa

Descrizione

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

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.