Skip to content

update required fields automatically when fields have default values #49

Closed
@loyada

Description

@loyada

In the following examples

class Foo(Structure):
   i: int = 5
   s1: String = "x"
   arr: Array(default=[1,2]) 
   map: dict
   _required=['arr', 's1', 'i']

"_required" should be automatically updated not to include any field that has a default value, so that the following:
Foo(map={})

is value.

Also, if no "_required" attribute is defined (which implies that all the fields are required), one will be created, and will contain only the fields that have no default values.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions