Any -> AnyClass

This commit is contained in:
Dave Halter
2020-05-10 03:17:52 +02:00
parent e9a0c01af8
commit e6e43413ff
2 changed files with 4 additions and 4 deletions

View File

@@ -23,8 +23,8 @@ class _BoundTypeVarName(AbstractNameDefinition):
def iter_():
for value in self._value_set:
# Replace any with the constraints if they are there.
from jedi.inference.gradual.typing import Any
if isinstance(value, Any):
from jedi.inference.gradual.typing import AnyClass
if isinstance(value, AnyClass):
for constraint in self._type_var.constraints:
yield constraint
else:

View File

@@ -67,7 +67,7 @@ class TypingModuleName(NameWrapper):
yield TypeVarClass.create_cached(
inference_state, self.parent_context, self.tree_name)
elif name == 'Any':
yield Any.create_cached(
yield AnyClass.create_cached(
inference_state, self.parent_context, self.tree_name)
elif name == 'TYPE_CHECKING':
# This is needed for e.g. imports that are only available for type
@@ -362,7 +362,7 @@ class Protocol(BaseTypingInstance):
pass
class Any(BaseTypingValue):
class AnyClass(BaseTypingValue):
def execute_annotation(self):
debug.warning('Used Any - returned no results')
return NO_VALUES