diff --git a/jedi/inference/compiled/mixed.py b/jedi/inference/compiled/mixed.py index 98959fd8..7d76113a 100644 --- a/jedi/inference/compiled/mixed.py +++ b/jedi/inference/compiled/mixed.py @@ -71,6 +71,13 @@ class MixedObject(ValueWrapper): else: return self.compiled_value.get_safe_value(default) + @property + def array_type(self): + return self.compiled_value.array_type + + def get_key_values(self): + return self.compiled_value.get_key_values() + def py__simple_getitem__(self, index): python_object = self.compiled_value.access_handle.access._obj if type(python_object) in ALLOWED_GETITEM_TYPES: diff --git a/test/test_api/test_interpreter.py b/test/test_api/test_interpreter.py index 1bd06405..ee7617ca 100644 --- a/test/test_api/test_interpreter.py +++ b/test/test_api/test_interpreter.py @@ -594,12 +594,18 @@ def test_param_annotation_completion(class_is_findable): ('mixed[Non', 9, ['e']), ('implicit[10', None, ['00']), + + ('inherited["', None, ['blablu"']), ] ) def test_dict_completion(code, column, expected): strs = {'asdf': 1, u"""foo""": 2, r'fbar': 3} mixed = {1: 2, 1.10: 4, None: 6, r'a\sdf': 8, b'foo': 9} + class Inherited(dict): + pass + inherited = Inherited(blablu=3) + namespaces = [locals(), {'implicit': {1000: 3}}] comps = jedi.Interpreter(code, namespaces).complete(column=column) if Ellipsis in expected: