Skip to content

Commit

Permalink
python now marshalls known collection types instead of interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
eirannejad committed Oct 11, 2023
1 parent 1671fc6 commit a2758dd
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/runtime/McNeel.PythonEngine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -611,10 +611,13 @@ static object MarshallOutput(object value)
{
switch (value)
{
case IEnumerable<object> enumerable:
case object[] array:
return array.Select(i => MarshallOutput(i)).ToArray();

case List<object> enumerable:
return enumerable.Select(i => MarshallOutput(i)).ToList();

case IDictionary<object, object> dict:
case Dictionary<object, object> dict:
return dict.Select(p =>
{
return new KeyValuePair<object, object>(MarshallOutput(p.Key), MarshallOutput(p.Value));
Expand Down

0 comments on commit a2758dd

Please sign in to comment.