[New-bugs-announce] [issue46637] Incorrect error message: "missing 1 required positional argument"

Anders Hovmöller report at bugs.python.org
Fri Feb 4 10:54:15 EST 2022


New submission from Anders Hovmöller <boxed at killingar.net>:

>>> def foo(a):
...     pass
... 
>>> foo()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: foo() missing 1 required positional argument: 'a'

This error is incorrect. It says "positional argument", but it's just "argument". The proof is that if you call it with

foo(a=3)

it works fine.

----------
components: Interpreter Core
messages: 412510
nosy: Anders.Hovmöller
priority: normal
severity: normal
status: open
title: Incorrect error message: "missing 1 required positional argument"
type: enhancement
versions: Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue46637>
_______________________________________


More information about the New-bugs-announce mailing list