ASEM000 / pytreeclass

Visualize, create, and operate on pytrees in the most intuitive way possible.
https://pytreeclass.rtfd.io/en/latest
Apache License 2.0
42 stars 2 forks source link

Python 3.11 dataclass will mark JAX arrays as mutable. #33

Closed ASEM000 closed 1 year ago

ASEM000 commented 1 year ago

deprecate the usage of data classes from v0.2, preferably implementing a minimal version of data classes. (i.e. only init generation for our case).

See: https://github.com/google/jax/issues/14295

ASEM000 commented 1 year ago

Implemented custom lightweight dataclasses-like alternative with the following differences

def field(
    *,
    default: Any | _NOT_SET = _NOT_SET,
    default_factory: Callable | None = None,
    init: bool = True,
    repr: bool = True,
    kw_only: bool = False,
    pos_only: bool = False,
    metadata: dict | None = None,
    callbacks: Sequence[Callable] | None = None,
):