| 251 | |
| 252 | |
| 253 | == Why not @datatype |
| 254 | The @datatype annotation from python offers serialization through the {{{asdict}}} method. |
| 255 | However it does not support polymorphism, it does not include the information needed to properly support polymorphism, and it does not offer the reverse method (e.g. from-dict). |
| 256 | |
| 257 | From from-dict functionality, you need to use a third party library, like [https://github.com/Cologler/dataclasses_fromdict-python dataclasses_fromdict], [https://github.com/konradhalas/dacite dacite] or [https://github.com/Fatal1ty/mashumaro mashumaro]. |
| 258 | |
| 259 | But even then polymorphic classes can not be deserialized, because the serialized form just does not contain the information required to do this. |