nucleic / atom

Memory efficient Python objects
https://atom.readthedocs.io/en/latest/
Other
361 stars 50 forks source link

Apply dataclass transform to AtomMeta #210

Open MatthieuDartiailh opened 8 months ago

MatthieuDartiailh commented 8 months ago

All members are declared as field specifiers which allow to use them in addition of an annotation.

I am considering adding other field specifiers to:

I am considering something along the following lines to stay close to the existing syntax.

class A(Atom):

    a: int = member(default=1).tag(a=1)

Any opinion @frmdstryr

Closes #173

frmdstryr commented 8 months ago

I still use the "old" method of just using members directly but this looks fine to me.

codecov[bot] commented 8 months ago

Codecov Report

Merging #210 (8b8e513) into main (d6a1b11) will decrease coverage by 1.74%. The diff coverage is 83.80%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #210 +/- ## ========================================== - Coverage 97.67% 95.93% -1.74% ========================================== Files 24 24 Lines 1075 1181 +106 Branches 174 200 +26 ========================================== + Hits 1050 1133 +83 - Misses 12 29 +17 - Partials 13 19 +6 ```