Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve support for list and dict properties #247

Open
peterbrittain opened this issue Apr 4, 2020 · 0 comments
Open

Improve support for list and dict properties #247

peterbrittain opened this issue Apr 4, 2020 · 0 comments

Comments

@peterbrittain
Copy link
Owner

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

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

No branches or pull requests

1 participant