Skip to content

Make struct native #18

Description

@emptybutton

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestinvalidThis doesn't seem rightobjectsobjects.py

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions