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

Make struct native #18

Open
emptybutton opened this issue Nov 17, 2023 · 0 comments
Open

Make struct native #18

emptybutton opened this issue Nov 17, 2023 · 0 comments
Labels
documentation Improvements or additions to documentation enhancement New feature or request invalid This doesn't seem right objects objects.py

Comments

@emptybutton
Copy link
Owner

struct "sees" only annotated attributes, but to set default values annotation is not needed, but to set them in struct they must still be annotated.

Need to implement this behavior for struct:

@struct
class Something:
    a: int
    b = 8


assert Something.b == 8
assert Something(int()).b == 8
@emptybutton emptybutton added documentation Improvements or additions to documentation enhancement New feature or request invalid This doesn't seem right objects objects.py labels Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request invalid This doesn't seem right objects objects.py
Projects
None yet
Development

No branches or pull requests

1 participant