The Wire · Showcase
PYDANTIC FIXES TYPE VARIABLE BUG IN SUBCLASS GENERICS
By RepoJournal · Filed · About FastAPI & Pydantic
Pydantic shipped a fix for type variable substitution failures in `__pydantic_extra__` when subclassing generic models, closing a long-standing issue that broke runtime validation for inherited types.
The fix [1] targets a core validation gap where type variables weren't properly substituted in extra attributes during subclass inheritance, a scenario that breaks serialization and validation pipelines relying on generic base classes. This is the kind of subtle bug that manifests in production when you're using discriminated unions or parameterized base models across a deep inheritance chain. FastAPI developers working with complex domain models should test their generic inheritance patterns after this lands [2]. On the sponsorship front, FastAPI's people roster got updated [3], reflecting the project's growing ecosystem of supporters. Nothing breaking in either shop; this is pure stability work.
One email a day. Unsubscribe in one click.
What actually shipped in FastAPI & Pydantic, written up every day — commits, pull requests, releases, and security advisories.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → Test generic model inheritance and __pydantic_extra__ access in your codebase pydantic/pydantic [plan]
- → Watch for Pydantic's next release to pull in the type variable fix pydantic/pydantic [monitor]
References
- [1] Fix type variable substitution in `__pydantic_extra__` with subclasses ↗ pydantic/pydantic
- [2] Fix type variable substitution in `__pydantic_extra__` with subclasses (#13483) pydantic/pydantic
- [3] 👥 Update FastAPI People - Sponsors ↗ fastapi/fastapi