Pywise

Latest version: v0.4.0

Safety actively analyzes 623704 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 2

0.4.0

Adds support to `deserialize` to handle types that have default values on one or more fields. When a field-value pair is not found during `deserialize`, it will use the type's defined default value for the field as the `value`. Supports arbitrary nesting of default values.

Thus the following will work now as of `0.4.0`:

from dataclasses import dataclass
from core_utils.serialization import *


dataclass(frozen=True)
class Hello:
name: str
value: int = 42


assert deserialize(Hello, {'name': 'world'}) == Hello(name="world", value=42)

0.3.2

Bugfix: support for properly deserializing Union types that contain generics (e.g. collection types such as `List`, `Dict`, etc.). In general, the following will work now:

deserialize(Union[A[B], C[D]], x)

For `dataclass(frozen=True) class A(Generic[B])` and `dataclass(frozen=True) class C(Generic[D])`.

0.3.1

0.3.0

0.2.0

0.1.2

Includes a bug fix, removing a debugging print statement in the deserialization routine that was accidentally left in in the prior release.

Page 1 of 2

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.