Changes between Version 75 and Version 76 of pyson


Ignore:
Timestamp:
11/29/23 14:01:19 (17 months ago)
Author:
wouter
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • pyson

    v75 v76  
    88
    99You can control the (de)serialization mapping using jackson-styled annotations.
     10
     11
     12===== Why not @datatype
     13The @datatype annotation from python offers serialization through the {{{asdict}}} method.
     14However 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).
     15
     16For 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].
     17
     18But even then polymorphic classes can not be deserialized, because the serialized form just does not contain the information required to do this.
     19
    1020
    1121
     
    327337{{{svn co https://tracinsy.ewi.tudelft.nl/pub/svn/Utilities/pyson}}}
    328338
    329 
    330 == Why not @datatype
    331 The @datatype annotation from python offers serialization through the {{{asdict}}} method.
    332 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).
    333 
    334 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].
    335 
    336 But even then polymorphic classes can not be deserialized, because the serialized form just does not contain the information required to do this.