TypeError: missing 1 required positional argument (tested)
TypeError: f() missing 1 required positional argument: 'x' means a call didn't supply a parameter that has no default. We measured the cases where that isn't obvious on Python 3.13.5, including one where you did pass the argument.
1. Calling a method on the class instead of an instance
class Greeter:
def hello(self, name):
return f"hi {name}"
try:
Greeter.hello("ada") # called on the class, not an instance
except TypeError as e:
print("Greeter.hello('ada'):", e)
try:
Greeter().hello()
except TypeError as e:
print("Greeter().hello():", e)
print(Greeter().hello("ada"))
Output:
Greeter.hello('ada'): Greeter.hello() missing 1 required positional argument: 'name'
Greeter().hello(): Greeter.hello() missing 1 required positional argument: 'name'
hi ada
Measured on Python 3.13.5: Greeter.hello("ada") puts "ada" into self, so name is missing. The message names the missing parameter, not self, which makes this one confusing. Create an instance first: Greeter().hello("ada"). The same error when you forgot the argument itself is the straightforward case.
2. Constructors, threads and callbacks
class Repo:
def __init__(self, path):
self.path = path
try:
r = Repo()
except TypeError as e:
print("Repo():", e)
import threading
def work(n):
print("work", n)
t = threading.Thread(target=work, args=(5,)) # args must be a tuple: (5,) not (5)
t.start(); t.join()
import functools
cb = functools.partial(work, 7) # bind arguments for callbacks
cb()
Output:
Repo(): Repo.__init__() missing 1 required positional argument: 'path'
work 5
work 7
Measured: __init__ parameters are required when you create the object. For threading.Thread, multiprocessing, map or GUI/button callbacks, pass the arguments the way the API expects: args=(5,) (a tuple, note the comma) or functools.partial(work, 7).
3. super().__init__() and decorators that drop arguments
class Base:
def __init__(self, name):
self.name = name
class Child(Base):
def __init__(self, name, size):
super().__init__() # forgot to pass name
self.size = size
try:
Child("box", 2)
except TypeError as e:
print(e)
def deco(fn):
def wrapper(*args, **kw):
print("args received:", args)
return fn() # forgot *args, **kw
return wrapper
@deco
def greet(name):
return "hi " + name
try:
greet("ada")
except TypeError as e:
print("decorated:", e)
Output:
Base.__init__() missing 1 required positional argument: 'name'
args received: ('ada',)
decorated: greet() missing 1 required positional argument: 'name'
Measured: the error points at Base.__init__ even though you called Child: pass the parent's arguments to super().__init__(name). In the decorator, the wrapper received ('ada',) but called fn() without it; forward with fn(*args, **kw) and add @functools.wraps(fn).
Frequently asked questions
What does TypeError: missing 1 required positional argument mean?
A function was called without a value for a parameter that has no default. The message names the parameter; we measured it for methods, constructors, super().__init__ and decorators on Python 3.13.5.
Why does it say missing 1 required positional argument when I passed it?
You probably called the method on the class (Greeter.hello('ada')), so your argument went into self. We measured that; call it on an instance instead.
How do I fix missing required positional argument in threading.Thread?
Pass args=(value,) as a tuple, or use functools.partial. We measured both running the target with its argument.
Why does super().__init__() raise missing required positional argument?
The parent's __init__ needs arguments you didn't forward. We measured Base.__init__() missing 'name' when Child called super().__init__() with nothing.
Written with AI assistance. Measured on 2026-10-09 with Python 3.13.5 on Linux: a method called on the class and without its argument, a constructor without arguments, threading.Thread args and functools.partial, super().__init__() without arguments, and a decorator that drops its arguments. Every block was run verbatim and its output pasted from that run. PlainHeaders is our extension; everything else here is built-in Python.