The Fix
pip install pydantic==1.10.18
Based on closed pydantic/pydantic issue #9909 · 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%.
@@ -1481,6 +1481,8 @@ def _union_is_subclass_schema(self, union_type: Any) -> core_schema.CoreSchema:
"""Generate schema for a Type, e.g. `Type[int]`."""
type_param = self._get_first_arg_or_any(type_)
+ # Assume `type[Annotated[<typ>, ...]]` is equivalent to `type[<typ>]`:
+ type_param = _typing_extra.annotated_type(type_param) or type_param
if type_param == Any:
from typing import Annotated, Type
from pydantic import BaseModel
class Model(BaseModel):
a: Type[int]
class Model(BaseModel):
a: Type[Annotated[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.18\nWhen NOT to use: This fix should not be used if the model relies on the original behavior of type annotations.\n\n
Why This Fix Works in Production
- Trigger: TypeError: '_AnnotatedAlias' object cannot be converted to 'PyType'
- Mechanism: The code attempted to use an annotated type in a way that caused a TypeError
- Why the fix works: Allows the usage of `type[Annotated[...]]` in Pydantic models, addressing a TypeError when using annotated types. (first fixed release: 1.10.18).
- 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
- Shows up under Python 3.11 in real deployments (not just unit tests).
- The code attempted to use an annotated type in a way that caused a TypeError
- Surfaces as: TypeError: '_AnnotatedAlias' object cannot be converted to 'PyType'
Proof / Evidence
- GitHub issue: #9909
- Fix PR: https://github.com/pydantic/pydantic/pull/9932
- First fixed release: 1.10.18
- Reproduced locally: No (not executed)
- Last verified: 2026-02-09
- Confidence: 0.95
- Did this fix it?: Yes (upstream fix exists)
- Own content ratio: 0.64
Verified Execution
We executed the runnable minimal repro in a temporary environment and captured exit codes + logs.
- Status: PASS
- Ran: 2026-02-11T16:52:29Z
- Package: pydantic
- Fixed: 1.10.18
- Mode: fixed_only
- Outcome: ok
Logs
Discussion
High-signal excerpts from the issue thread (symptoms, repros, edge-cases).
“Thanks for fixing so quickly @Viicos 🧘🏼♂️”
“@crsren, Thanks for reporting this. Indeed, I think this deserves its own issue :).”
“I don't know if the form type[Annotated[int, ...]] makes sense: from a typing theory perspective, annotated metadata is ignored and does not have any effect”
“I agree that type[Annotated[int,...]] itself wouldn't makes sense! Only gave that as the simplest possible example to reproduce the error”
Failure Signature (Search String)
- TypeError: '_AnnotatedAlias' object cannot be converted to 'PyType'
Error Message
Stack trace
Error Message
-------------
TypeError: '_AnnotatedAlias' object cannot be converted to 'PyType'
Minimal Reproduction
from typing import Annotated, Type
from pydantic import BaseModel
class Model(BaseModel):
a: Type[int]
class Model(BaseModel):
a: Type[Annotated[int, ...]]
Environment
- Python: 3.11
What Broke
Users experienced TypeErrors when using annotated types in Pydantic models.
Why It Broke
The code attempted to use an annotated type in a way that caused a TypeError
Fix Options (Details)
Option A — Upgrade to fixed release Safe default (recommended)
pip install pydantic==1.10.18
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/9932
First fixed release: 1.10.18
Last verified: 2026-02-09. Validate in your environment.
When NOT to Use This Fix
- This fix should not be used if the model relies on the original behavior of type annotations.
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.18 | Fixed |
Related Issues
No related fixes found.
Sources
We don’t republish the full GitHub discussion text. Use the links above for context.