Refine Python pattern boundaries and Pydantic guidance
This commit is contained in:
+7
-2
@@ -106,9 +106,14 @@ If runtime safety matters, attribute-presence checks are not enough. Protocols d
|
||||
|
||||
### Pydantic
|
||||
|
||||
- `pydantic/main.py:156-205` exposes typed `ClassVar[...]` metadata for config, fields, serializer, and validator state even though framework internals are dynamic.
|
||||
- `pydantic/main.py:156-205` exposes typed `ClassVar[...]` metadata for config, schema, fields, serializer, and validator state even though framework internals are dynamic.
|
||||
- `pydantic/main.py:167-168` documents a synthesized `__init__` signature, which is another signal that annotations shape the runtime boundary.
|
||||
- `pydantic/main.py:253-264` makes model construction validate `**data: Any` immediately instead of pretending arbitrary inputs are already safe.
|
||||
- `pydantic/main.py:721-768` gives `model_validate(...) -> Self` an explicit typed boundary contract.
|
||||
- `pydantic/main.py:721-768` gives `model_validate(...) -> Self` an explicit typed boundary contract with runtime validation options.
|
||||
|
||||
## Related comparison
|
||||
|
||||
- `comparison/pydantic-vs-python.md`
|
||||
|
||||
## Bottom line
|
||||
|
||||
|
||||
Reference in New Issue
Block a user