File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -110,16 +110,6 @@ internal static IntPtr ToPython(Object value, Type type) {
110
110
return ClassDerivedObject . ToPython ( pyderived ) ;
111
111
}
112
112
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
-
123
113
// hmm - from Python, we almost never care what the declared
124
114
// type is. we'd rather have the object bound to the actual
125
115
// implementing class.
@@ -194,6 +184,15 @@ internal static IntPtr ToPython(Object value, Type type) {
194
184
return Runtime . PyLong_FromUnsignedLongLong ( ( ulong ) value ) ;
195
185
196
186
default :
187
+ if ( value is IEnumerable )
188
+ {
189
+ var resultlist = new PyList ( ) ;
190
+ foreach ( object o in ( IEnumerable ) value )
191
+ {
192
+ resultlist . Append ( new PyObject ( ToPython ( o , o . GetType ( ) ) ) ) ;
193
+ }
194
+ return resultlist . Handle ;
195
+ }
197
196
result = CLRObject . GetInstHandle ( value , type ) ;
198
197
return result ;
199
198
}
You can’t perform that action at this time.
0 commit comments