utils.py 文件源码

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

项目:SFC_models 作者: brianr747 项目源码 文件源码
def get_invalid_tokens():
    """
    Get a list of invalid tokens that can be used inside sfc_model equations.

    :return: list
    """
    internal = ['self', 'None']
    kw = keyword.kwlist
    if is_python_3:
        built = dir(builtins)
    else:  # pragma: no cover
        built = dir(__builtin__)
    out = internal + kw + built
    # Need to add back in some semi-mathematical operations
    good_tokens = ('float', 'max', 'min', 'sum', 'pow', 'abs', 'round', 'pow')
    out = (x for x in out if x not in good_tokens)
    return list(out)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号