Skip to content

Commit b6ba65a

Browse files
committed
Special handling for objects attribute
1 parent 65bdc52 commit b6ba65a

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

param/__init__.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1165,6 +1165,11 @@ def get_range(self):
11651165

11661166

11671167
class SelectObjects(list):
1168+
"""
1169+
Wrapper around Selector.objects which allows both list-like and
1170+
dictionary like updates to the set of objects, ensuring backward
1171+
compatibility for setting objects as lists and dictionaries.
1172+
"""
11681173

11691174
def __init__(self, iterable, parameter=None):
11701175
super(SelectObjects, self).__init__(iterable)
@@ -1180,6 +1185,7 @@ def _warn(self, method):
11801185

11811186
@contextmanager
11821187
def _trigger(self, trigger=True):
1188+
trigger = 'objects' in self._parameter.watchers and trigger
11831189
old = dict(self._parameter.names) or list(self._parameter._objects)
11841190
yield
11851191
if trigger:

0 commit comments

Comments
 (0)