I have a relatively deep object tree in C# that needs to be initialized from IronPython.
I'm new to python and I'm struggling with the initialization of arrays.
So as an example - say I have these classes in C#
public class Class1
{
public string Foo {get;set;}
}
public class Class2
{
List<Class1> ClassOnes {get;set;}
}
I can initialize the array in Class2 like so:
var class2 = new Class2(
ClassOnes = new List<Class1>()
{
new Class1(Foo="bar")
});
In IronPython - I was trying this:
bar = Class2
bar.ClassOnes = Class1[Class1(Foo="bar")]
But I always get this message:
expected Array[Type], got Class1
Any ideas?