make a slow inspect.getdoc() call lazy, which improves performance for numpy completions by 30%

This commit is contained in:
Dave Halter
2014-04-11 11:53:11 +02:00
parent a6bfb1b3ad
commit 27645af6d2

View File

@@ -24,7 +24,10 @@ class CompiledObject(Base):
def __init__(self, obj, parent=None):
self.obj = obj
self.parent = parent
self.doc = inspect.getdoc(obj) or ''
@property
def doc(self):
return inspect.getdoc(self.obj) or ''
@property
def params(self):