1
0
forked from VimPlug/jedi

create an is_callable method for all representation objects, to determine if something is callable or not

This commit is contained in:
Dave Halter
2014-04-02 09:42:15 +02:00
parent d1a6dd1098
commit 305b593f3b
5 changed files with 35 additions and 9 deletions

View File

@@ -138,6 +138,10 @@ class CompiledObject(Base):
def get_imports(self):
return [] # Builtins don't have imports
def is_callable(self):
"""Check if the object has a ``__call__`` method."""
return hasattr(self.obj, '__call__')
class CompiledName(object):
def __init__(self, obj, name):