Random objects should not be affected by list/dict modifications

This commit is contained in:
Dave Halter
2019-08-26 19:28:30 +02:00
parent 356c25a399
commit 24b392b915
2 changed files with 12 additions and 2 deletions

View File

@@ -140,9 +140,12 @@ class HelperValueMixin(object):
class Value(HelperValueMixin, BaseValue):
"""
To be defined by subclasses.
To be implemented by subclasses.
"""
tree_node = None
# Possible values: None, tuple, list, dict and set. Here to deal with these
# very important containers.
array_type = None
@property
def api_type(self):

View File

@@ -327,7 +327,7 @@ some_lst[0]
some_lst[1]
# -----------------
# set setitem (should not work)
# set setitem/other modifications (should not work)
# -----------------
some_set = {int}
@@ -337,6 +337,13 @@ some_set[0]
#? int
some_set[3]
something = object()
something[3] = str
#?
something[0]
#?
something[3]
# -----------------
# dict setitem
# -----------------