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

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

项目: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 __init__(self, evaluator, name, pos):
        self.name = FakeName(name, self, pos)
        self.start_pos = pos
        self.parent = evaluator.BUILTINS
项目:pythonVSCode    作者:DonJayamanne    | 项目源码 | 文件源码
def only_valid_as_leaf(self):
        return self.name.value in keywords_only_valid_as_leaf
项目:pythonVSCode    作者:DonJayamanne    | 项目源码 | 文件源码
def names(self):
        """ For a `parsing.Name` like comparision """
        return [self.name]
项目:pythonVSCode    作者:DonJayamanne    | 项目源码 | 文件源码
def docstr(self):
        return imitate_pydoc(self.name)
项目: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 __init__(self, evaluator, name):
        self.string_name = name
        self.parent_context = evaluator.BUILTINS
项目:leetcode    作者:thomasyimgit    | 项目源码 | 文件源码
def __init__(self, evaluator, name, pos):
        self.name = KeywordName(evaluator, name)
        self.start_pos = pos
        self.parent = evaluator.BUILTINS
项目:leetcode    作者:thomasyimgit    | 项目源码 | 文件源码
def only_valid_as_leaf(self):
        return self.name.value in keywords_only_valid_as_leaf
项目:leetcode    作者:thomasyimgit    | 项目源码 | 文件源码
def names(self):
        """ For a `parsing.Name` like comparision """
        return [self.name]
项目:leetcode    作者:thomasyimgit    | 项目源码 | 文件源码
def __repr__(self):
        return '<%s: %s>' % (type(self).__name__, self.name)
项目: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 __init__(self, evaluator, name, pos):
        self.name = FakeName(name, self, pos)
        self.start_pos = pos
        self.parent = evaluator.BUILTINS
项目:sublimeTextConfig    作者:luoye-fe    | 项目源码 | 文件源码
def only_valid_as_leaf(self):
        return self.name.value in keywords_only_valid_as_leaf
项目:sublimeTextConfig    作者:luoye-fe    | 项目源码 | 文件源码
def names(self):
        """ For a `parsing.Name` like comparision """
        return [self.name]
项目:sublimeTextConfig    作者:luoye-fe    | 项目源码 | 文件源码
def docstr(self):
        return imitate_pydoc(self.name)
项目:.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 __init__(self, evaluator, name):
        self.string_name = name
        self.parent_context = evaluator.BUILTINS
项目:.emacs.d    作者:christabella    | 项目源码 | 文件源码
def __init__(self, evaluator, name, pos):
        self.name = KeywordName(evaluator, name)
        self.start_pos = pos
        self.parent = evaluator.BUILTINS
项目:.emacs.d    作者:christabella    | 项目源码 | 文件源码
def only_valid_as_leaf(self):
        return self.name.value in keywords_only_valid_as_leaf
项目:.emacs.d    作者:christabella    | 项目源码 | 文件源码
def names(self):
        """ For a `parsing.Name` like comparision """
        return [self.name]
项目:.emacs.d    作者:christabella    | 项目源码 | 文件源码
def __repr__(self):
        return '<%s: %s>' % (type(self).__name__, self.name)
项目: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 __init__(self, evaluator, name):
        self.string_name = name
        self.parent_context = evaluator.BUILTINS
项目:wuye.vim    作者:zhaoyingnan911    | 项目源码 | 文件源码
def __init__(self, evaluator, name, pos):
        self.name = KeywordName(evaluator, name)
        self.start_pos = pos
        self.parent = evaluator.BUILTINS
项目:wuye.vim    作者:zhaoyingnan911    | 项目源码 | 文件源码
def only_valid_as_leaf(self):
        return self.name.value in keywords_only_valid_as_leaf
项目:wuye.vim    作者:zhaoyingnan911    | 项目源码 | 文件源码
def names(self):
        """ For a `parsing.Name` like comparision """
        return [self.name]
项目:wuye.vim    作者:zhaoyingnan911    | 项目源码 | 文件源码
def __repr__(self):
        return '<%s: %s>' % (type(self).__name__, self.name)
项目: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 __init__(self, evaluator, name):
        self.evaluator = evaluator
        self.string_name = name
        self.parent_context = evaluator.BUILTINS
项目:yatta_reader    作者:sound88    | 项目源码 | 文件源码
def __init__(self, evaluator, name, pos):
        self.name = KeywordName(evaluator, name)
        self.start_pos = pos
        self.parent = evaluator.BUILTINS
项目:yatta_reader    作者:sound88    | 项目源码 | 文件源码
def only_valid_as_leaf(self):
        return self.name.value in keywords_only_valid_as_leaf
项目:yatta_reader    作者:sound88    | 项目源码 | 文件源码
def names(self):
        """ For a `parsing.Name` like comparision """
        return [self.name]
项目:yatta_reader    作者:sound88    | 项目源码 | 文件源码
def __repr__(self):
        return '<%s: %s>' % (type(self).__name__, self.name)