reportMissingParameterType.md
April 8, 2026 · View on GitHub
Overview
reportMissingParameterType is a diagnostic in Pylance and Pyright that warns when a function or method parameter is missing a type annotation. This helps catch missing or ambiguous type information, improving code clarity and type safety.
Representative Issues
- #3078: Always provide type hints for function parameters to avoid diagnostic errors in static analysis tools.
- #2735: Provide specific configuration options for type check diagnostics to improve code maintainability.
- #774: When using decorators that modify the signature of a function, use TypeVars bound to Callable types to maintain the original signatures.
Examples
def greet(name): # Warning: Type of parameter "name" is unknown
print(f"Hello, {name}")
def add(a, b): # Warning: Type of parameter "a" is unknown
return a + b
Fix — add type annotations to parameters:
def greet(name: str) -> None:
print(f"Hello, {name}")
def add(a: int, b: int) -> int:
return a + b
Common Fixes & Workarounds
- Add explicit type annotations to all function and method parameters.
- Use type stubs or install third-party stubs for external libraries.
- Review and update type hints in your codebase for completeness.
- Review the Pyright configuration documentation for options to adjust or suppress this diagnostic if needed.
See Also
python.analysis.diagnosticSeverityOverrides— adjust or suppress this diagnosticpython.analysis.typeCheckingMode— controls which diagnostics are enabled by default