Python ast 模块,Nonlocal() 实例源码

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

项目:mutpy    作者:mutpy    | 项目源码 | 文件源码
def get_coverable_nodes(cls):
        return {
            ast.Assert,
            ast.Assign,
            ast.AugAssign,
            ast.Break,
            ast.Continue,
            ast.Delete,
            ast.Expr,
            ast.Global,
            ast.Import,
            ast.ImportFrom,
            ast.Nonlocal,
            ast.Pass,
            ast.Raise,
            ast.Return,
            ast.FunctionDef,
            ast.ClassDef,
            ast.TryExcept,
            ast.TryFinally,
            ast.ExceptHandler,
            ast.If,
            ast.For,
            ast.While,
        }
项目:mutpy    作者:mutpy    | 项目源码 | 文件源码
def get_coverable_nodes(cls):
        return {
            ast.Assert,
            ast.Assign,
            ast.AugAssign,
            ast.Break,
            ast.Continue,
            ast.Delete,
            ast.Expr,
            ast.Global,
            ast.Import,
            ast.ImportFrom,
            ast.Nonlocal,
            ast.Pass,
            ast.Raise,
            ast.Return,
            ast.ClassDef,
            ast.FunctionDef,
            ast.Try,
            ast.ExceptHandler,
            ast.If,
            ast.For,
            ast.While,
        }
项目:web_ctp    作者:molebot    | 项目源码 | 文件源码
def test_nonlocal(self):
        self.stmt(ast.Nonlocal([]), "empty names on Nonlocal")
项目:ouroboros    作者:pybee    | 项目源码 | 文件源码
def test_nonlocal(self):
        self.stmt(ast.Nonlocal([]), "empty names on Nonlocal")
项目:kbe_server    作者:xiaohaoppy    | 项目源码 | 文件源码
def test_nonlocal(self):
        self.stmt(ast.Nonlocal([]), "empty names on Nonlocal")