python
call-signature
ai_generated
true
TypeError: __init__() missing 1 required positional argument: 'name'
ID: python/typeerror-missing-required-arg
98%Fix Rate
99%Confidence
50Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 311 | active | — | — | — |
Root Cause
Function or method called without providing all required arguments.
genericWorkarounds
-
98% success Pass all required arguments: MyClass(name='value') or check the function signature
Use help(func) or inspect.signature(func) to see required parameters
Sources: https://docs.python.org/3/library/inspect.html#inspect.signature
-
93% success If subclassing, ensure super().__init__() is called with all required args
super().__init__(name=name) — pass through parent's required parameters
Dead Ends
Common approaches that don't work:
-
Making all arguments optional with defaults
65% fail
Hides API contract; None defaults cause AttributeError later
-
Using *args to absorb extra/missing arguments
80% fail
Breaks function signatures; IDE help becomes useless
Error Chain
Frequently confused with: