mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
Random objects should not be affected by list/dict modifications
This commit is contained in:
@@ -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):
|
||||
|
||||
@@ -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
|
||||
# -----------------
|
||||
|
||||
Reference in New Issue
Block a user