Skip to content

Commit f3ff88d

Browse files
committed
merge from patstew-master
1 parent 95f123c commit f3ff88d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pythonnet/src/runtime/converter.cs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,16 @@ internal static IntPtr ToPython(Object value, Type type) {
110110
return ClassDerivedObject.ToPython(pyderived);
111111
}
112112

113+
if (value is IEnumerable)
114+
{
115+
var resultlist = new PyList();
116+
foreach (object o in (IEnumerable)value)
117+
{
118+
resultlist.Append(new PyObject(ToPython(o, o.GetType())));
119+
}
120+
return resultlist.Handle;
121+
}
122+
113123
// hmm - from Python, we almost never care what the declared
114124
// type is. we'd rather have the object bound to the actual
115125
// implementing class.

0 commit comments

Comments
 (0)