Hello

This sample code throws error on Python object initialization:

            var engine = Python.CreateEngine();
            var Ops = engine.CreateOperations();
            engine.Runtime.LoadAssembly(typeof(Decimal).Assembly);
            var src =
                @"
class Checker:
  def __init__(self, one, two, three=''):
    self.one = one
    self.two = two
    self.tree = three
  def Call(self):
    return self.one + self.two + self.tree
";

            var cs = engine.CreateScriptSourceFromString(src, 
SourceCodeKind.Statements).Compile();
            cs.Execute();
            var tclass = cs.DefaultScope.GetVariable("Checker");
            object obj = 
cs.Engine.Operations.Call(tclass,"one","two","three");// throw 
NotImplementedException

            Console.WriteLine(obj);

But if I use only 2 parameter in initialize/constructor such as :

           object obj = cs.Engine.Operations.Call(tclass,"one","two");

, than all works fine. 

What wrong ?

Best regards
Igor Elyas
_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to