Skip to content

Unable to set Default field #26

@brherger

Description

@brherger

Based on the unit test test_dataclass_const_default, it does not appear we can set the default fields.

I would expect that is possible per construct.Default documentation.

>>> ConstDefaultTest(default_int=5)
Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm 2022.3\plugins\python\helpers\pydev\_pydevd_bundle\pydevd_exec2.py", line 3, in Exec
    exec(exp, global_vars, local_vars)
  File "<input>", line 1, in <module>
TypeError: ConstDefaultTest.__init__() got an unexpected keyword argument 'default_int'

Python 3.11.4
construct==2.10.68
construct-typing==0.5.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions