From 46da1df5ae706ce567331750fba6e338648f967f Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Fri, 14 Dec 2018 09:37:30 +0100 Subject: [PATCH] Add an assert that makes it impossible to nest classes of the same type --- jedi/plugins/typeshed.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jedi/plugins/typeshed.py b/jedi/plugins/typeshed.py index ed489943..7f322272 100644 --- a/jedi/plugins/typeshed.py +++ b/jedi/plugins/typeshed.py @@ -232,8 +232,6 @@ class CompiledStubName(NameWrapper): @memoize_method @iterator_to_context_set def infer(self): - # Here we probably don't have to care about contexts that are not - # available. It would be a compiled_contexts = self._compiled_name.infer() stub_contexts = self._wrapped_name.infer() @@ -248,6 +246,8 @@ class CompiledStubName(NameWrapper): # behaves this way. yield stub_context elif stub_context.is_class(): + assert not isinstance(stub_context, CompiledStubClass), \ + "%s and %s" % (self._wrapped_name, self._compiled_name) yield CompiledStubClass.create_cached( stub_context.evaluator, stub_context, actual_context) elif stub_context.is_function():