Skip to content

Make struct native #18

@emptybutton

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

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