mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 22:14:27 +08:00
dict_values should be accessible for CompiledObjects.
This commit is contained in:
@@ -277,6 +277,9 @@ class CompiledObject(Context):
|
||||
def get_imports(self):
|
||||
return [] # Builtins don't have imports
|
||||
|
||||
def dict_values(self):
|
||||
return set(create(self.evaluator, v) for v in self.obj.values())
|
||||
|
||||
|
||||
class CompiledName(AbstractNameDefinition):
|
||||
def __init__(self, evaluator, parent_context, name):
|
||||
|
||||
@@ -92,3 +92,7 @@ def test_time_docstring():
|
||||
import time
|
||||
comp, = Script('import time\ntime.sleep').completions()
|
||||
assert comp.docstring() == time.sleep.__doc__
|
||||
|
||||
|
||||
def test_dict_values():
|
||||
assert Script('import sys/sys.modules["alshdb;lasdhf"]').goto_definitions()
|
||||
|
||||
Reference in New Issue
Block a user