mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 05:54:25 +08:00
TypedDictBase -> TypedDictClass
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user