Python keyword 模块,only_valid_as_leaf() 实例源码

我们从Python开源项目中,提取了以下12个代码示例,用于说明如何使用keyword.only_valid_as_leaf()

项目:pythonVSCode    作者:DonJayamanne    | 项目源码 | 文件源码
def completion_names(evaluator, stmt, pos, module):
    keyword_list = all_keywords(evaluator)

    if not isinstance(stmt, Leaf) or has_inappropriate_leaf_keyword(pos, module):
        keyword_list = filter(
            lambda keyword: not keyword.only_valid_as_leaf,
            keyword_list
        )
    return [keyword.name for keyword in keyword_list]
项目:pythonVSCode    作者:DonJayamanne    | 项目源码 | 文件源码
def only_valid_as_leaf(self):
        return self.name.value in keywords_only_valid_as_leaf
项目:leetcode    作者:thomasyimgit    | 项目源码 | 文件源码
def completion_names(evaluator, stmt, pos, module):
    keyword_list = all_keywords(evaluator)

    if not isinstance(stmt, Leaf) or has_inappropriate_leaf_keyword(pos, module):
        keyword_list = filter(
            lambda keyword: not keyword.only_valid_as_leaf,
            keyword_list
        )
    return [keyword.name for keyword in keyword_list]
项目:leetcode    作者:thomasyimgit    | 项目源码 | 文件源码
def only_valid_as_leaf(self):
        return self.name.value in keywords_only_valid_as_leaf
项目:sublimeTextConfig    作者:luoye-fe    | 项目源码 | 文件源码
def completion_names(evaluator, stmt, pos, module):
    keyword_list = all_keywords(evaluator)

    if not isinstance(stmt, Leaf) or has_inappropriate_leaf_keyword(pos, module):
        keyword_list = filter(
            lambda keyword: not keyword.only_valid_as_leaf,
            keyword_list
        )
    return [keyword.name for keyword in keyword_list]
项目:sublimeTextConfig    作者:luoye-fe    | 项目源码 | 文件源码
def only_valid_as_leaf(self):
        return self.name.value in keywords_only_valid_as_leaf
项目:.emacs.d    作者:christabella    | 项目源码 | 文件源码
def completion_names(evaluator, stmt, pos, module):
    keyword_list = all_keywords(evaluator)

    if not isinstance(stmt, Leaf) or has_inappropriate_leaf_keyword(pos, module):
        keyword_list = filter(
            lambda keyword: not keyword.only_valid_as_leaf,
            keyword_list
        )
    return [keyword.name for keyword in keyword_list]
项目:.emacs.d    作者:christabella    | 项目源码 | 文件源码
def only_valid_as_leaf(self):
        return self.name.value in keywords_only_valid_as_leaf
项目:wuye.vim    作者:zhaoyingnan911    | 项目源码 | 文件源码
def completion_names(evaluator, stmt, pos, module):
    keyword_list = all_keywords(evaluator)

    if not isinstance(stmt, Leaf) or has_inappropriate_leaf_keyword(pos, module):
        keyword_list = filter(
            lambda keyword: not keyword.only_valid_as_leaf,
            keyword_list
        )
    return [keyword.name for keyword in keyword_list]
项目:wuye.vim    作者:zhaoyingnan911    | 项目源码 | 文件源码
def only_valid_as_leaf(self):
        return self.name.value in keywords_only_valid_as_leaf
项目:yatta_reader    作者:sound88    | 项目源码 | 文件源码
def completion_names(evaluator, stmt, pos, module):
    keyword_list = all_keywords(evaluator)

    if not isinstance(stmt, Leaf) or has_inappropriate_leaf_keyword(pos, module):
        keyword_list = filter(
            lambda keyword: not keyword.only_valid_as_leaf,
            keyword_list
        )
    return [keyword.name for keyword in keyword_list]
项目:yatta_reader    作者:sound88    | 项目源码 | 文件源码
def only_valid_as_leaf(self):
        return self.name.value in keywords_only_valid_as_leaf