The error messages of `dict()` and `dict().update()` should say `positional argument` instead of only `argument`
Offen
@serhiy-storchaka arbeitet bereits daran.
Seit 26.8.2025.
interpreter-core
type-bug
- Vorherrschende Sprache
- Python
- Sterne
- 77.2k
- Forks
- 35.9k
- PR-Merge-Kennzahlen
- PR-Kennzahlen ausstehend
Beschreibung
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
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.