From e9a0c01af8101ff0a5156fd5a7f935e1608d15e5 Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Sun, 10 May 2020 03:17:07 +0200 Subject: [PATCH] TypedDictBase -> TypedDictClass --- jedi/inference/gradual/typing.py | 4 ++-- jedi/inference/value/klass.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/jedi/inference/gradual/typing.py b/jedi/inference/gradual/typing.py index 9d77f6d0..6ff34286 100644 --- a/jedi/inference/gradual/typing.py +++ b/jedi/inference/gradual/typing.py @@ -85,7 +85,7 @@ class TypingModuleName(NameWrapper): elif name == 'TypedDict': # TODO doesn't even exist in typeshed/typing.py, yet. But will be # added soon. - yield TypedDictBase.create_cached( + yield TypedDictClass.create_cached( inference_state, self.parent_context, self.tree_name) elif name in ('no_type_check', 'no_type_check_decorator'): # This is not necessary, as long as we are not doing type checking. @@ -416,7 +416,7 @@ class CastFunction(BaseTypingValue): return type_value_set.execute_annotation() -class TypedDictBase(BaseTypingValue): +class TypedDictClass(BaseTypingValue): """ This class has no responsibilities and is just here to make sure that typed dicts can be identified. diff --git a/jedi/inference/value/klass.py b/jedi/inference/value/klass.py index 89bc7925..ec51b24a 100644 --- a/jedi/inference/value/klass.py +++ b/jedi/inference/value/klass.py @@ -241,7 +241,7 @@ class ClassMixin(object): def is_typeddict(self): # TODO Do a proper mro resolution. Currently we are just listing # classes. However, it's a complicated algorithm. - from jedi.inference.gradual.typing import TypedDictBase + from jedi.inference.gradual.typing import TypedDictClass for lazy_cls in self.py__bases__(): if not isinstance(lazy_cls, LazyTreeValue): return False @@ -253,7 +253,7 @@ class ClassMixin(object): return False for cls in lazy_cls.infer(): - if isinstance(cls, TypedDictBase): + if isinstance(cls, TypedDictClass): return True try: method = cls.is_typeddict