- Pydantic and the `match` statement speaker - what will this do? audience:...
#pyconus - Pydantic and the `match` statement
speaker - what will this do?
audience: mumble
speaker - right!
I'm getting annoyed.
Self-replies
Scenario: What if we had a stream of dicts (a discriminated union) with a union with Any....
Option 1- if/elif on the discriminator field
Option 2- Add a `match` statement that won't be recognized by subsequent maintainers of the code base.
TypeAdapter an undefined concept.
"Type adapters provide a flexible way to perform validation and serialization based on a Python type." ah, yes. Flexible.
Here is the official tutorial