Skip to content

Improve support for list and dict properties #247

@peterbrittain

Description

@peterbrittain

Is your feature request related to a problem? Please describe.
Some widgets return lists or dicts as properties. As described in https://stackoverflow.com/questions/3137685/using-property-decorator-on-dicts and https://stackoverflow.com/questions/37564798/python-property-on-a-list these don't work as expected when you use the setitem logic on them - e.g. widget.value[2] = "something". It simply updates the local list/dict returned by the property rather than the widget value.

Describe the solution you'd like
This should update the widget value instead. I expect this means I need to return some proxy list/dict on the getter that will pass changes on to the parent widget. Care needs to be taken on handling deep copies, though.

Describe alternatives you've considered
Could possibly just exposethis as an extra method on the widget instead. I'll need that official interface anyway for the proxy object.

Additional context
None

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions