TYPE006warningPro

dict-type-inconsistency

Dict return type annotation doesn't match actual value types being assigned.

Applies to: Python

Why this matters

When a function claims to return Dict[str, str] but assigns untyped values from iterating over a Dict[str, Any] input, type checkers trust the annotation and won't catch runtime errors. This bug surfaces far from where the problem is - often when Pydantic/FastAPI validate at runtime. Use consistent types or validate/convert values.

Catch it before it ships

pip install stablestack # or: npx stablestackstablestack # scans your project, TYPE006 includedstablestack explain TYPE006

TYPE006 is part of the Pro rule set. See pricing — the free tier ships 24 checks with no signup.

False positive in your codebase? Suppress a single line with # noqa: TYPE006