numpydoc.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:tensorly 作者: tensorly 项目源码 文件源码
def mangle_signature(app, what, name, obj, options, sig, retann):
    # Do not try to inspect classes that don't define `__init__`
    if (inspect.isclass(obj) and
        (not hasattr(obj, '__init__') or
            'initializes x; see ' in pydoc.getdoc(obj.__init__))):
        return '', ''

    if not (isinstance(obj, collections.Callable) or
            hasattr(obj, '__argspec_is_invalid_')):
        return

    if not hasattr(obj, '__doc__'):
        return

    doc = SphinxDocString(pydoc.getdoc(obj))
    if doc['Signature']:
        sig = re.sub(sixu("^[^(]*"), sixu(""), doc['Signature'])
        return sig, sixu('')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号