mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-18 19:45:57 +08:00
clean up the is_callable stuff
This commit is contained in:
@@ -542,8 +542,6 @@ class Script(object):
|
|||||||
origins = cache.cache_call_signatures(_callable, user_stmt)
|
origins = cache.cache_call_signatures(_callable, user_stmt)
|
||||||
debug.speed('func_call followed')
|
debug.speed('func_call followed')
|
||||||
|
|
||||||
print([classes.CallSignature(self._evaluator, o, call, index)
|
|
||||||
for o in origins])
|
|
||||||
return [classes.CallSignature(self._evaluator, o, call, index)
|
return [classes.CallSignature(self._evaluator, o, call, index)
|
||||||
for o in origins if o.is_callable()]
|
for o in origins if o.is_callable()]
|
||||||
|
|
||||||
|
|||||||
@@ -298,11 +298,10 @@ class BaseDefinition(object):
|
|||||||
if isinstance(stripped, pr.Name):
|
if isinstance(stripped, pr.Name):
|
||||||
stripped = stripped.parent
|
stripped = stripped.parent
|
||||||
|
|
||||||
return (stripped.isinstance(er.Function, er.Class)
|
return stripped.is_callable()
|
||||||
or stripped.isinstance(compiled.CompiledObject)
|
|
||||||
and stripped.type() in ('function', 'class'))
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
|
@cache.underscore_memoization
|
||||||
def params(self):
|
def params(self):
|
||||||
"""
|
"""
|
||||||
Raises an ``AttributeError``if the definition is not callable.
|
Raises an ``AttributeError``if the definition is not callable.
|
||||||
|
|||||||
Reference in New Issue
Block a user