Skip to content

PreferencesHelper unable to synchronize mutations on nested containers #194

@kitchoi

Description

@kitchoi

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']]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions