mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-06 05:54:25 +08:00
Make sure that Callables are properly represented
See also comment of https://github.com/davidhalter/jedi/pull/1614#issuecomment-647054740
This commit is contained in:
@@ -97,6 +97,9 @@ class HelperValueMixin(object):
|
|||||||
debug.warning('Tried to run __await__ on value %s', self)
|
debug.warning('Tried to run __await__ on value %s', self)
|
||||||
return await_value_set.execute_with_values()
|
return await_value_set.execute_with_values()
|
||||||
|
|
||||||
|
def py__name__(self):
|
||||||
|
return self.name.string_name
|
||||||
|
|
||||||
def iterate(self, contextualized_node=None, is_async=False):
|
def iterate(self, contextualized_node=None, is_async=False):
|
||||||
debug.dbg('iterate %s', self)
|
debug.dbg('iterate %s', self)
|
||||||
if is_async:
|
if is_async:
|
||||||
@@ -262,9 +265,6 @@ class Value(HelperValueMixin):
|
|||||||
def name(self):
|
def name(self):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
def py__name__(self):
|
|
||||||
return self.name.string_name
|
|
||||||
|
|
||||||
def get_type_hint(self, add_class_info=True):
|
def get_type_hint(self, add_class_info=True):
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
@@ -415,6 +415,9 @@ class BaseTypingInstance(LazyValueWrapper):
|
|||||||
def get_annotated_class_object(self):
|
def get_annotated_class_object(self):
|
||||||
return self._class_value
|
return self._class_value
|
||||||
|
|
||||||
|
def get_qualified_names(self):
|
||||||
|
return (self.py__name__(),)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
return ValueName(self, self._tree_name)
|
return ValueName(self, self._tree_name)
|
||||||
|
|||||||
@@ -417,6 +417,7 @@ type_in_out2()
|
|||||||
type_in_out2(float)
|
type_in_out2(float)
|
||||||
|
|
||||||
def ma(a: typing.Callable[[str], TYPE_VARX]) -> typing.Callable[[str], TYPE_VARX]:
|
def ma(a: typing.Callable[[str], TYPE_VARX]) -> typing.Callable[[str], TYPE_VARX]:
|
||||||
|
#? typing.Callable()
|
||||||
return a
|
return a
|
||||||
|
|
||||||
def mf(s: str) -> int:
|
def mf(s: str) -> int:
|
||||||
|
|||||||
Reference in New Issue
Block a user