From 50f6bb02991ba38bc13935822098bb173d89af84 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 15 May 2016 23:06:07 +0200 Subject: [PATCH] When we are working with CompiledObjects and instances there should never be a case where class values are returned. --- jedi/evaluate/compiled/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/jedi/evaluate/compiled/__init__.py b/jedi/evaluate/compiled/__init__.py index f9b4d314..29a9233d 100644 --- a/jedi/evaluate/compiled/__init__.py +++ b/jedi/evaluate/compiled/__init__.py @@ -155,7 +155,12 @@ class CompiledObject(Base): search_global shouldn't change the fact that there's one dict, this way there's only one `object`. """ - return [LazyNamesDict(self._evaluator, self._cls(), is_instance)] + cls = self._cls() + if cls != self: + # If we are working with a class, the names_dict should not include + # class names. + is_instance = True + return [LazyNamesDict(self._evaluator, cls, is_instance)] def get_subscope_by_name(self, name): if name in dir(self._cls().obj):