Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Apply dataclass transform to AtomMeta #210

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

MatthieuDartiailh
Copy link
Member

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:

  • allow to tag a member without needing to rely on a member
  • allow to specify a default value factory
  • I would like to be able to specify arg/kwargs for Typed/Instance but this cannot be statically validated...

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
Copy link
Contributor

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

All members are declared as field specifiers.
Copy link

codecov bot commented Mar 25, 2024

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
@@            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     

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate support for PEP681 : dataclass_transform
2 participants