Changes between Version 54 and Version 55 of pyson


Ignore:
Timestamp:
08/12/21 13:31:15 (3 years ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • pyson

    v54 v55  
    249249
    250250{{{svn co https://tracinsy.ewi.tudelft.nl/pub/svn/Utilities/pyson}}}
     251
     252
     253== Why not @datatype
     254The @datatype annotation from python offers serialization through the {{{asdict}}} method.
     255However 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
     257From 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
     259But even then polymorphic classes can not be deserialized, because the serialized form just does not contain the information required to do this.