本文整理汇总了C#中PythonTuple.ToArray方法的典型用法代码示例。如果您正苦于以下问题:C# PythonTuple.ToArray方法的具体用法?C# PythonTuple.ToArray怎么用?C# PythonTuple.ToArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PythonTuple
的用法示例。
在下文中一共展示了PythonTuple.ToArray方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PythonFunction
/// <summary>
/// Python ctor - maps to function.__new__
///
/// y = func(x.__code__, globals(), 'foo', None, (a, ))
/// </summary>
public PythonFunction(CodeContext context, FunctionCode code, PythonDictionary globals, string name, PythonTuple defaults, PythonTuple closure) {
if (closure != null && closure.__len__() != 0) {
throw new NotImplementedException("non empty closure argument is not supported");
}
if (globals == context.GlobalDict) {
_module = context.Module.GetName();
_context = context;
} else {
_module = null;
_context = new CodeContext(new PythonDictionary(), new ModuleContext(globals, DefaultContext.DefaultPythonContext));
}
_defaults = defaults == null ? ArrayUtils.EmptyObjects : defaults.ToArray();
_code = code;
_name = name;
_doc = code._initialDoc;
Closure = null;
var scopeStatement = _code.PythonCode;
if (scopeStatement.IsClosure) {
throw new NotImplementedException("code containing closures is not supported");
}
scopeStatement.RewriteBody(FunctionDefinition.ArbitraryGlobalsVisitorInstance);
_compat = CalculatedCachedCompat();
}