enthought / enthought/apptools

PreferencesHelper unable to synchronize mutations on nested containers

Open
#194 1 comment 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Python
Stars
38
Forks
21
PR merge metrics
No merged PRs in 30d

Description

Similar to #129, currently mutations on nested containers for traits defined on a subclass of PreferencesHelper cannot be synchronized with the Preferences.

e.g.
```
from apptools.preferences.api import Preferences, PreferencesHelper
from traits.api import Int, List, Str

class MyPreferencesHelper(PreferencesHelper):
preferences_path = Str('my_section')
list_of_list_of_str = List(List(Str))

pref = Preferences(filename="tmp.ini")
helper = MyPreferencesHelper(preferences=pref, list_of_list_of_str=[["1"]])
helper.list_of_list_of_str[0].append("9")
pref.save()

```

The saved preferences would be:
```
[my_section]
list_of_list_of_str = [['1']]
```

Expected:
```
[my_section]
list_of_list_of_str = [['1', '9']]
```

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.