• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Runtime.List类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中IronPython.Runtime.List的典型用法代码示例。如果您正苦于以下问题:C# List类的具体用法?C# List怎么用?C# List使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



List类属于IronPython.Runtime命名空间,在下文中一共展示了List类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Compare

 internal Compare(BinaryExpression expr, cmpop op)
     : this() {
     _left = Convert(expr.Left);
     _ops = PythonOps.MakeListNoCopy(op);
     _comparators = PythonOps.MakeListNoCopy(Convert(expr.Right));
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:6,代码来源:_ast.cs


示例2: BoolOp

 internal BoolOp(AndExpression and)
     : this() {
     _values = PythonOps.MakeListNoCopy(Convert(and.Left), Convert(and.Right));
     _op = And.Instance;
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:5,代码来源:_ast.cs


示例3: Call

            internal Call(CallExpression call)
                : this() {
                _args = PythonOps.MakeEmptyList(call.Args.Count);
                _keywords = new PythonList();
                _func = Convert(call.Target);
                foreach (IronPython.Compiler.Ast.Arg arg in call.Args) {

                    if (arg.Name == null)
                        _args.Add(Convert(arg.Expression));
                    else if (arg.Name == "*")
                        _starargs = Convert(arg.Expression);
                    else if (arg.Name == "**")
                        _kwargs = Convert(arg.Expression);
                    else
                        _keywords.Add(new keyword(arg));
                }
            }
开发者ID:rchandrashekara,项目名称:main,代码行数:17,代码来源:_ast.cs


示例4: Convert

            internal static PythonList Convert(ComprehensionIterator[] iters) {
                PythonList comps = new PythonList();
                int start = 1;
                for (int i = 0; i < iters.Length; i++) {
                    if (i == 0 || iters[i] is ComprehensionIf)
                        if (i == iters.Length - 1)
                            i++;
                        else
                            continue;

                    ComprehensionIf[] ifs = new ComprehensionIf[i - start];
                    Array.Copy(iters, start, ifs, 0, ifs.Length);
                    comps.Add(new comprehension((ComprehensionFor)iters[start - 1], ifs));
                    start = i + 1;
                }
                return comps;
            }
开发者ID:rchandrashekara,项目名称:main,代码行数:17,代码来源:_ast.cs


示例5: comprehension

 internal comprehension(ComprehensionFor listFor, ComprehensionIf[] listIfs)
     : this() {
     _target = Convert(listFor.Left, Store.Instance);
     _iter = Convert(listFor.List);
     _ifs = PythonOps.MakeEmptyList(listIfs.Length);
     foreach (ComprehensionIf listIf in listIfs)
         _ifs.Add(Convert(listIf.Test));
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:8,代码来源:_ast.cs


示例6: TryFinally

 internal TryFinally(PythonList body, PythonList finalbody)
     : this() {
     _body = body;
     _finalbody = finalbody;
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:5,代码来源:_ast.cs


示例7: FunctionDef

            internal FunctionDef(FunctionDefinition def)
                : this() {
                _name = def.Name;
                _args = new arguments(def.Parameters);
                _body = ConvertStatements(def.Body);

                if (def.Decorators != null) {
                    _decorators = PythonOps.MakeEmptyList(def.Decorators.Count);
                    foreach (Compiler.Ast.Expression expr in def.Decorators)
                        _decorators.Add(Convert(expr));
                } else
                    _decorators = PythonOps.MakeEmptyList(0);
            }
开发者ID:rchandrashekara,项目名称:main,代码行数:13,代码来源:_ast.cs


示例8: GeneratorExp

 internal GeneratorExp(GeneratorExpression expr)
     : this() {
     ExtractListComprehensionIterators walker = new ExtractListComprehensionIterators();
     expr.Function.Body.Walk(walker);
     ComprehensionIterator[] iters = walker.Iterators;
     Debug.Assert(iters.Length != 0, "A generator expression cannot have zero iterators.");
     iters[0] = new ComprehensionFor(((ComprehensionFor)iters[0]).Left, expr.Iterable);
     _elt = Convert(walker.Yield.Expression);
     _generators = Convert(iters);
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:10,代码来源:_ast.cs


示例9: ExtSlice

 internal ExtSlice(PythonList dims)
     : this() {
     _dims = dims;
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:4,代码来源:_ast.cs


示例10: For

 internal For(ForStatement stmt)
     : this() {
     _target = Convert(stmt.Left, Store.Instance);
     _iter = Convert(stmt.List);
     _body = ConvertStatements(stmt.Body);
     _orelse = ConvertStatements(stmt.Else, true);
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:7,代码来源:_ast.cs


示例11: Dict

 internal Dict(DictionaryExpression expr)
     : this() {
     _keys = PythonOps.MakeEmptyList(expr.Items.Count);
     _values = PythonOps.MakeEmptyList(expr.Items.Count);
     foreach (SliceExpression item in expr.Items) {
         _keys.Add(Convert(item.SliceStart));
         _values.Add(Convert(item.SliceStop));
     }
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:9,代码来源:_ast.cs


示例12: Delete

 internal Delete(DelStatement stmt)
     : this() {
     _targets = PythonOps.MakeEmptyList(stmt.Expressions.Count);
     foreach (Compiler.Ast.Expression expr in stmt.Expressions)
         _targets.Add(Convert(expr, Del.Instance));
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:6,代码来源:_ast.cs


示例13: Print

            internal Print(PrintStatement stmt)
                : this() {
                if (stmt.Destination != null)
                    _dest = Convert(stmt.Destination);

                _values = PythonOps.MakeEmptyList(stmt.Expressions.Count);
                foreach (Compiler.Ast.Expression expr in stmt.Expressions)
                    _values.Add(Convert(expr));

                _nl = !stmt.TrailingComma;
            }
开发者ID:rchandrashekara,项目名称:main,代码行数:11,代码来源:_ast.cs


示例14: Global

 internal Global(GlobalStatement stmt)
     : this() {
     _names = new PythonList(stmt.Names);
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:4,代码来源:_ast.cs


示例15: TryExcept

            internal TryExcept(TryStatement stmt)
                : this() {
                _body = ConvertStatements(stmt.Body);

                _handlers = PythonOps.MakeEmptyList(stmt.Handlers.Count);
                foreach (TryStatementHandler tryStmt in stmt.Handlers)
                    _handlers.Add(Convert(tryStmt));

                _orelse = ConvertStatements(stmt.Else, true);
            }
开发者ID:rchandrashekara,项目名称:main,代码行数:10,代码来源:_ast.cs


示例16: Tuple

            internal Tuple(TupleExpression list, expr_context ctx)
                : this() {
                _elts = PythonOps.MakeEmptyList(list.Items.Count);
                foreach (Compiler.Ast.Expression expr in list.Items)
                    _elts.Add(Convert(expr, ctx));

                _ctx = ctx;
            }
开发者ID:rchandrashekara,项目名称:main,代码行数:8,代码来源:_ast.cs


示例17: arguments

 internal arguments(IList<Parameter> parameters)
     : this() {
     _args = PythonOps.MakeEmptyList(parameters.Count);
     _defaults = PythonOps.MakeEmptyList(parameters.Count);
     foreach (Parameter param in parameters) {
         if (param.IsList)
             _vararg = param.Name;
         else if (param.IsDictionary)
             _kwarg = param.Name;
         else {
             args.Add(new Name(param.Name, Param.Instance));
             if (param.DefaultValue != null)
                 defaults.Add(Convert(param.DefaultValue));
         }
     }
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:16,代码来源:_ast.cs


示例18: Assign

            internal Assign(AssignmentStatement stmt)
                : this() {
                _targets = PythonOps.MakeEmptyList(stmt.Left.Count);
                foreach (Compiler.Ast.Expression expr in stmt.Left)
                    _targets.Add(Convert(expr, Store.Instance));

                _value = Convert(stmt.Right);
            }
开发者ID:rchandrashekara,项目名称:main,代码行数:8,代码来源:_ast.cs


示例19: ListComp

 internal ListComp(ListComprehension comp)
     : this() {
     _elt = Convert(comp.Item);
     _generators = Convert(comp.Iterators);
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:5,代码来源:_ast.cs


示例20: ClassDef

 internal ClassDef(ClassDefinition def)
     : this() {
     _name = def.Name;
     _bases = PythonOps.MakeEmptyList(def.Bases.Count);
     foreach (Compiler.Ast.Expression expr in def.Bases)
         _bases.Add(Convert(expr));
     _body = ConvertStatements(def.Body);
     _decorator_list = new PythonList(); // TODO Actually fill in the decorators here
 }
开发者ID:rchandrashekara,项目名称:main,代码行数:9,代码来源:_ast.cs



注:本文中的IronPython.Runtime.List类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Runtime.PythonContext类代码示例发布时间:2022-05-26
下一篇:
C# Runtime.DictionaryStorage类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap