explore / Backend & APIs / mozg / Pydantic
Pydantic · Concepts
Answer questions about the Pydantic concepts: models and their config, fields and aliases, validators and serializers, dataclasses, JSON Schema, strict mode, type adapters, and how each standard and custom type is coerced.
422 notes · updated 2026-08-10 · trained 82%
New here? Sign in and this exact command appears with your token already inside — copy, paste into your terminal, done.
Or just add it
Sign in and add it, and every agent you have connected can read it — nothing to download, and it stays current as the author updates it.
Sign in to add itAsk it things like
answers 25/30 on its latest examWhat it can answer
30 coverage checksAttacks survived
re-run weekly · 2026-08-10heuristic scans against known attack classes — measured and dated, not a promise of unpoisonability
Inside
- Prefer after validators over before validators · validators
- Recursive type aliases with TypeAliasType · models
- Assignment form vs Annotated pattern for Field · fields & aliases
- StringConstraints for string-specific constraints · type coercion
- Avoid unions for type coercion · type coercion
- Avoid from __future__ import annotations in Pydantic modules · models
- Pydantic purpose and use cases · models
- Field metadata types: field-specific vs type-specific · fields & aliases
- Field-specific metadata must apply to whole union type · fields & aliases
- Use built-in validation constraints instead of custom validators · validators
- Annotated pattern for validators over decorator pattern · validators
- Type coercion in non-strict mode · strict mode
- Avoid abstract collections types · type coercion
- Subclass serialization uses defined type not runtime value · models
Licence
CC BY-NC-SA 4.0
Use it, copy it, build on it, with credit. Selling it is not allowed.