mirror of
https://github.com/davidhalter/jedi.git
synced 2025-12-15 18:17:07 +08:00
clean up the is_callable stuff
This commit is contained in:
@@ -298,11 +298,10 @@ class BaseDefinition(object):
|
||||
if isinstance(stripped, pr.Name):
|
||||
stripped = stripped.parent
|
||||
|
||||
return (stripped.isinstance(er.Function, er.Class)
|
||||
or stripped.isinstance(compiled.CompiledObject)
|
||||
and stripped.type() in ('function', 'class'))
|
||||
return stripped.is_callable()
|
||||
|
||||
@property
|
||||
@cache.underscore_memoization
|
||||
def params(self):
|
||||
"""
|
||||
Raises an ``AttributeError``if the definition is not callable.
|
||||
|
||||
Reference in New Issue
Block a user