Skip to content

Releases: Fatal1ty/mashumaro

v3.0.4

11 Aug 08:02
Compare
Choose a tag to compare

Changes

  • Fixed using fields with init=False β€” they are skipped during deserialization now. See #82.

v3.0.3

08 Jun 10:20
Compare
Choose a tag to compare

Changes

  • Fixed using dialects for DataClassMessagePackMixin. See #76.

v3.0.2

06 Jun 21:49
Compare
Choose a tag to compare

Changes

  • Fixed using dialects with inheritance. See #78.

v3.0.1

15 Apr 18:14
Compare
Choose a tag to compare

Changes

  • Fixed using Optional in tuples, named tuples and typed dicts. See #73.

v3.0

09 Feb 13:52
Compare
Choose a tag to compare

Changes

  • Added support for new types:
    • typing.NewType
    • typing.Literal
    • typing_extensions.Literal
    • typing.Annotated
    • typing_extensions.Annotated
    • zoneinfo.ZoneInfo
    • typing_extensions.OrderedDict on Python<3.7.2.
  • Fixed using field options when using dataclass slots=True on Python 3.10 (#68).
  • Fixed using postponed evaluation with parent class (#70).
  • Fixed not removing field metadata options for the overridden field without them.
  • Fixed serialization of SerializableType generic classes.
  • Added new pass_through object that can be used in serialization_strategy and serialize / deserialize options.
  • Reduced code building time.
  • Use encoder and decoder written in C for YAML by default if available.

Backward incompatible changes

  • Moved msgpack, pyyaml dependencies to extras_require (#7).
  • Moved DataClassJSONMixin, DataClassMessagePackMixin, DataClassYAMLMixin to mashumaro.mixins.* subpackages.
  • Removed use_bytes, use_enum, use_datetime parameters from DataClassDictMixin methods.
  • Removed encoder and decoder kwargs from to_*, from_* methods of the serialization mixins in order to pass keyword arguments to underlying to_dict, from_dict methods.

You can find migration guide here: https://github.com/Fatal1ty/mashumaro/blob/master/docs/2to3.md.

v2.11

04 Jan 20:08
Compare
Choose a tag to compare

Changes

  • PEP 604 compliance.
  • Fixed that Union[None, X] with None on the first place wasn't treated as Optional[X].
  • Fixed that Union[X, T] where T was resolved to None wasn't treated as Optional[X].
  • Allow using None as the field type (it's considered equivalent to NoneType).
  • Changed the name of NoneType to None in Unions for convenience. In the previous versions you could see Union[int, str, NoneType] instead of Union[int, str, None] if the field was declared as Union[int, str, None].

v2.10.1

30 Dec 23:13
Compare
Choose a tag to compare

Changes

  • Fixed using nested classes with future annotations import. See #62.

v2.10

30 Dec 20:39
Compare
Choose a tag to compare

Changes

  • Added support for dialects.
  • Fixed type hints for to_msgpack and from_msgpack methods. See #63.
  • Fixed serialzation / deserialization override using serialization_strategy config option in a generic dataclass.

v2.9.1

18 Dec 14:37
Compare
Choose a tag to compare

Changes

  • Fixed installing with third-party tool pdistx. See #60.
  • Fixed serialzation / deserialization override for Union and TypeVar types. See #61.
  • Fixed the default value of by_alias argument of to_dict method when using serialize_by_alias config option. In the previous versions by_alias argument had a default valueFalse regardless of whether serialize_by_alias config options was used. Now it could be True:
@dataclass
class MyClass(DataClassDictMixin):
    x: int

    class Config(BaseConfig):
        aliases = {"x": "x_alias"}
        serialize_by_alias = True
        code_generation_options = [TO_DICT_ADD_BY_ALIAS_FLAG]

print(MyClass(x=1).to_dict())  # {'x_alias': 1}
print(MyClass(x=1).to_dict(by_alias=False))  # {x': 1}

v2.9

02 Nov 07:29
Compare
Choose a tag to compare
  • Added support for PEP 563 postponed evaluation of annotations. See here for details.
  • Added ability to treat named tuples as dictionaries during serialization/deserialization: