The Fix
pip install pydantic==1.10.20
Based on closed pydantic/pydantic issue #11183 · PR/commit linked
Production note: Most teams hit this during upgrades or environment changes. Roll out with a canary and smoke critical endpoints (health, OpenAPI/docs) before 100%.
@@ -11,7 +11,7 @@
from functools import lru_cache, partial
from types import FunctionType
-from typing import Any, Callable, Generic, Literal, NoReturn, TypeVar, cast
+from typing import Any, Callable, Generic, Literal, NoReturn, cast
from pydantic import BaseModel
class Inner[T](BaseModel):
v: T
class Holder(BaseModel):
inner: Inner[int]
# Note that unlike "normal" classes, parametrized generic Pydantic models are classes themselves.
# This means that `Inner[int]` is a class (and not a generic alias instance), and
# `Inner[int].mro() == [Inner[int], Inner, BaseModel, object]`
Holder(inner=Inner[int](v=1))
# ok, `isinstance(Inner[int](v=1), Inner[int]) == True`
Holder(inner=Inner(v=1))
# not ok, `isinstance(Inner(v=1), Inner[int]) == False`, although this is valid
# for static type checkers as the type variable is implicitly solved to `int`.
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Option A — Upgrade to fixed release\npip install pydantic==1.10.20\nWhen NOT to use: Do not apply this fix if custom MRO behavior is required for specific use cases.\n\n
Why This Fix Works in Production
- Trigger: Validation of parametrized generics issues
- Mechanism: The custom MRO implementation for Pydantic models was unnecessary due to previous changes
- Why the fix works: Removed the custom MRO implementation for Pydantic models as it is no longer necessary due to previous changes. (first fixed release: 1.10.20).
- If left unfixed, the same config can fail only in production (env differences), causing startup failures or partial feature outages.
Why This Breaks in Prod
- The custom MRO implementation for Pydantic models was unnecessary due to previous changes
- Production symptom (often without a traceback): Validation of parametrized generics issues
Proof / Evidence
- GitHub issue: #11183
- Fix PR: https://github.com/pydantic/pydantic/pull/11184
- First fixed release: 1.10.20
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.85
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.52
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“This all sounds good to me @Viicos. Thanks for summarizing and providing clear examples.”
“One question: Did you mean isinstance(Inner[str](), Inner) (emphasis on the str, not int)?”
“We are going to remove the custom MRO implementation for now and keep the origin fallback "workaround"”
Failure Signature (Search String)
- Validation of parametrized generics issues
- In this example, `pydantic-core` did an `isinstance(Model2(), Model1)` check and this failed.
Copy-friendly signature
Failure Signature
-----------------
Validation of parametrized generics issues
In this example, `pydantic-core` did an `isinstance(Model2(), Model1)` check and this failed.
Error Message
Signature-only (no traceback captured)
Error Message
-------------
Validation of parametrized generics issues
In this example, `pydantic-core` did an `isinstance(Model2(), Model1)` check and this failed.
Minimal Reproduction
from pydantic import BaseModel
class Inner[T](BaseModel):
v: T
class Holder(BaseModel):
inner: Inner[int]
# Note that unlike "normal" classes, parametrized generic Pydantic models are classes themselves.
# This means that `Inner[int]` is a class (and not a generic alias instance), and
# `Inner[int].mro() == [Inner[int], Inner, BaseModel, object]`
Holder(inner=Inner[int](v=1))
# ok, `isinstance(Inner[int](v=1), Inner[int]) == True`
Holder(inner=Inner(v=1))
# not ok, `isinstance(Inner(v=1), Inner[int]) == False`, although this is valid
# for static type checkers as the type variable is implicitly solved to `int`.
Environment
- Pydantic: 2
What Broke
Invalid instances of parametrized generics were allowed, leading to potential runtime errors.
Why It Broke
The custom MRO implementation for Pydantic models was unnecessary due to previous changes
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==1.10.20
Use when you can deploy the upstream fix. It is usually lower-risk than long-lived workarounds.
Fix reference: https://github.com/pydantic/pydantic/pull/11184
First fixed release: 1.10.20
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- Do not apply this fix if custom MRO behavior is required for specific use cases.
Verify Fix
Re-run the minimal reproduction on your broken version, then apply the fix and re-run.
Did This Fix Work in Your Case?
Quick signal helps us prioritize which fixes to verify and improve.
Prevention
- Add a CI check that diffs key outputs after upgrades (OpenAPI schema snapshots, JSON payload shapes, CLI output).
- Upgrade behind a canary and run integration tests against the canary before 100% rollout.
Version Compatibility Table
| Version | Status |
|---|---|
| 1.10.20 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.