約158件1ページ目

日本語のみで絞り込む

2023/6/1 -If you are willing to switch to Pydantic instead of dataclasses , you can define a discriminated union via typing.Annotated and use the ...

Discriminated unions are sometimes referred to as “Tagged unions”. Unions can be validated more efficiently using a discriminator, by specifically choosing ...

2025/7/21 -It's also known as the tagged union, disjoint union, and discriminated union. The “sum” refers to the summing of the amount of distinct ...

2023/9/13 -When modeling semi-structured data, discriminated unions are an invaluable tool in your arsenal. It allows you to model a variable unit of ...

There is now full support for defining dataclasses as Union type arguments. The reason it did not generally work before, is because the data being de-serialized ...

2026/9/16 -A discriminated union is a type alias over its variants, read through the runtime's WireDiscriminator . On deserialization it reads the ...

2022/12/14 -Finally, I want any subclasses I make to automatically be added to the union. Well that's not possible with python typing, it should be possible ...

When unions are deserialized, they can be accommodated by a "union mapper" to identify based on a value in the payload how that payload can be deserialized.

2024/3/23 -Right, but it's not valid to discriminate unions in python based on the presence of attributes, except in the case of runtime checkable ...

2020/10/14 -The key idea: define each constructor as a dataclass, put the constructors together into an ADT using a Union type, and use isinstance tests to ...