$ the-wire · showcase
Pydantic stabilizes MISSING sentinel, adds TypeForm support
By RepoJournal · Filed · About FastAPI & Pydantic · Composed from the cited sources · methodology
Pydantic shipped three substantial type-system changes: a stabilized MISSING sentinel, TypeForm support, and a refactor that makes the Decimal JSON Schema pattern constraint opt-in.
Pydantic stabilized the `MISSING` sentinel [1], replacing the previous `Sentinel` typing approach. The change notes that pyright 1.1.413 does not yet ship updated `typing_extensions` stubs using `sentinel` instead of `Sentinel`, so a future release will follow once those stubs land. For anyone who introspects Pydantic's sentinel in type-checked code, expect a temporary gap between runtime behavior and static analysis.
`TypeForm` support landed [2], closing a long-standing set of requests. The same PR removes `enableExperimentalFeatures` and adds a pyrefly config alongside updated type ignores in the typechecking tests. If you relied on the experimental flag to gate earlier type behavior, that switch is gone.
The `Decimal` JSON Schema `pattern` constraint was refactored and is now opt-in [3]. The PR fixes two reported issues but explicitly makes the pattern opt-in because it is "quite complex still, and could cause issues downstream." If your JSON Schema consumers were relying on the generated `Decimal` pattern appearing by default, that output will differ unless you opt in.
Separately, Pydantic fixed race conditions in the free-threaded build [4], addressing a reported issue plus other spotted problems. Free-threaded users should pick this up. Lazy import support also landed but waits on CPython PR 156940 to be merged; tests are xfailed until the final CPython release [5], so this is groundwork rather than something to rely on today.
Action items
- → Audit JSON Schema consumers for Decimal pattern output and opt in explicitly if needed pydantic/pydantic [plan]
- → Upgrade if you run Pydantic on free-threaded CPython to pick up race condition fixes pydantic/pydantic [plan]
- → Remove enableExperimentalFeatures usage and adopt TypeForm pydantic/pydantic [plan]
- → Track CPython PR 156940; lazy imports stay xfailed until final release pydantic/pydantic [monitor]
References
- [1] Stabilize `MISSING` sentinel ↗ pydantic/pydantic
- [2] Add support for `TypeForm` ↗ pydantic/pydantic
- [3] Refactor `Decimal` JSON Schema `pattern` constraint ↗ pydantic/pydantic
- [4] Fix race conditions in freethreaded build ↗ pydantic/pydantic
- [5] Add support for lazy imports ↗ pydantic/pydantic