Ok the discriminated unions with pydantic thing has been irking me for a while so I finally dove deep, and wrote a thing about it. I'm sure you can do better with pydantic-internals black magic, but this gets me 90% there and is actually maintainable. marius.vision/p/introducin...
marius.visionmarius.vision - introducing-duck-unions-python-pydantic-and-discriminated-unions
0 reposts0 likes